Updated the docs to include new jump operands and setup the assembler to handle parsing all the jump instructions.

This commit is contained in:
2023-03-29 22:30:12 -05:00
parent a9a50055a4
commit 288ba9f9cb
5 changed files with 80 additions and 7 deletions
+52
View File
@@ -264,6 +264,58 @@ void HandleOpcode(void) {
case POP:
ExpectRegister();
break;
case JMP:
{
Token* arg = PeekToken();
if (arg->Class == IdentifierClass) {
ExpectIdentifier(0, ForwardParser);
opcode->Value.Mnemonic = JMPA;
opcode->Lemexe = "JMPA";
}
else ExpectRegister();
}
break;
case JZ:
{
Token* arg = PeekToken();
if (arg->Class == IdentifierClass) {
ExpectIdentifier(0, ForwardParser);
opcode->Value.Mnemonic = JZA;
opcode->Lemexe = "JZA";
}
else ExpectRegister();
}
break;
case JG:
{
Token* arg = PeekToken();
if (arg->Class == IdentifierClass) {
ExpectIdentifier(0, ForwardParser);
opcode->Value.Mnemonic = JGA;
opcode->Lemexe = "JGA";
}
else ExpectRegister();
}
break;
case JL:
{
Token* arg = PeekToken();
if (arg->Class == IdentifierClass) {
ExpectIdentifier(0, ForwardParser);
opcode->Value.Mnemonic = JLA;
opcode->Lemexe = "JLA";
}
else ExpectRegister();
}
break;
default:
break;
}