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:
2022-08-29 19:29:34 +00:00
parent 5f437b6869
commit 6c7b8d5356
4 changed files with 26 additions and 16 deletions
+3 -2
View File
@@ -32,8 +32,9 @@ void Disassemble(unsigned char image[HIGHMEMORY]) {
IsRegisterPattern(instruction & 0x07, parameter1);
unsigned char parameterType = instruction & 0x18;
if (!parameterType) {
IsRegisterPattern(Image[position], parameter2);
if (parameterType == REGMASK) {
IsRegisterPattern(Image[position + 1], parameter2);
position += 2;
} else if (parameterType == CONSTMASK) {
snprintf(parameter2, sizeof(char) * 31, "%d", Image[position + 1] + Image[position + 2]);
position += 3;