Added support for the STORE directive.
This commit is contained in:
+32
-1
@@ -167,7 +167,38 @@ void HandleAssemblerDirective() {
|
||||
break;
|
||||
case Store:
|
||||
{
|
||||
|
||||
AdvanceParser();
|
||||
|
||||
Token* next = PeekToken();
|
||||
|
||||
if (next->Class != DirectiveClass) {
|
||||
//If the token after the current one is invalid then the expect function ahead will exit, so we can
|
||||
//go ahead and change the STORE directive into a proper opcode here.
|
||||
directive->Value.Mnemonic = STOW;
|
||||
directive->Class = MnemonicClass;
|
||||
directive->Lemexe = "STOW";
|
||||
}
|
||||
else {
|
||||
if (next->Value.Directive != Byte) {
|
||||
fprintf(stderr, "[Line %d] Syntax error, expected keyword 'byte'.\n", next->LineNumber);
|
||||
exit(10);
|
||||
}
|
||||
|
||||
RemoveCurrentToken(); //Remove byte modifier token.
|
||||
AdvanceParser();
|
||||
|
||||
directive->Value.Mnemonic = STOB;
|
||||
directive->Class = MnemonicClass;
|
||||
directive->Lemexe = "STOB";
|
||||
}
|
||||
|
||||
ExpectRegister();
|
||||
|
||||
ExpectPuncuation(Comma, ForwardParser);
|
||||
|
||||
ExpectRegister();
|
||||
|
||||
ExpectLineEndOrFileEnd(ForwardParser);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user