minor fixes & error checking but still JE

Q bug?
This commit is contained in:
xamidev
2024-10-24 17:27:26 +02:00
parent 59688d05c4
commit accbdc38e7
5 changed files with 33 additions and 8 deletions

View File

@@ -153,10 +153,8 @@ void assemble(char* filename)
}
else if (strncmp(line, "JEQ", 3) == 0)
{
sscanf(line, "%s %[^,], %d", instruction, reg1, &addr);
int reg1_n = reg1[1] - '0';
sscanf(line, "%s %d", instruction, &addr);
buffer[i++] = JEQ;
buffer[i++] = reg1_n;
buffer[i++] = addr;
}
else if (strncmp(line, "JMP", 3) == 0)