Added negate opcode to equality opcode, in the second byte

This commit is contained in:
2024-10-03 10:15:58 +10:00
parent 5db3e407b1
commit ab1c9b941f
8 changed files with 74 additions and 26 deletions

View File

@@ -167,12 +167,7 @@ static void writeInstructionBinary(Toy_Routine** rt, Toy_AstBinary ast) {
}
else if (ast.flag == TOY_AST_FLAG_COMPARE_NOT) {
EMIT_BYTE(rt, TOY_OPCODE_COMPARE_EQUAL);
EMIT_BYTE(rt, 0);
EMIT_BYTE(rt, 0);
EMIT_BYTE(rt, 0);
EMIT_BYTE(rt, TOY_OPCODE_NEGATE); //TODO: squeeze these into one word
EMIT_BYTE(rt, 0);
EMIT_BYTE(rt, TOY_OPCODE_NEGATE); //squeezed into one word
EMIT_BYTE(rt, 0);
EMIT_BYTE(rt, 0);