Fixed a bug where CMP REG, REG wouldn't get encoded and a disassembler bug related to said CMP bug.
This commit is contained in:
+10
-1
@@ -199,7 +199,16 @@ void HandleRegisterBasedOpcode(unsigned char instruction, unsigned char mask) {
|
||||
Memory[ProgramCounter + 1] = *value & 0xFF;
|
||||
|
||||
AdvanceParser();
|
||||
} else {
|
||||
}
|
||||
else if (token->token_class == Reg) {
|
||||
Memory[ProgramCounter] = (PeekToken()->type - R1) & 0x07;
|
||||
|
||||
AdvanceParser();
|
||||
|
||||
ProgramCounter++;
|
||||
return;
|
||||
}
|
||||
else {
|
||||
fprintf(stderr, "[Error] Expected operand, got %s\n", token->lexeme);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user