Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/pasm_vm.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ interpretation_result vm_interpret(uint32_t *bytecode) {
break;

case OP_CMP:
vm.f = vm.r0 == arg;
vm.f = vm.r1 == arg;
break;

case OP_JMP_IF_F:
Expand Down
4 changes: 4 additions & 0 deletions src/to_bytecode.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ uint32_t* to_bytecode(FILE* fp, uint32_t *bytecode) {
} else if (!strcmp(op, "JMP_IF_NOT_F")) {
bytecode[bytecode_idx] = 0x0f000000;
bytecode[bytecode_idx] |= 0x00ffffff & atoi(arg);
}
else if (!strcmp(op, "CMP")) {
bytecode[bytecode_idx] = 0c0d000000;
bytecode[bytecode_idx] |= 0x00ffffff & atoi(arg);
} else puts("IDIOT");
//printf("%x\n", bytecode[bytecode_idx]);
bytecode_idx++;
Expand Down