1
0
Fork 0
mirror of https://github.com/pnx/m16vm synced 2026-06-16 03:44:55 +02:00

src/cpu.c: implement OP_INT instead of OP_SYSC_WR

This commit is contained in:
Henrik Hautakoski 2018-10-28 14:23:35 +01:00
parent fa30f39d55
commit bae062cbf9
No known key found for this signature in database
GPG key ID: 839F3A7EAFAEAFAA

View file

@ -88,9 +88,9 @@ static void execute(struct instr *instr) {
if (reg[instr->ri.rs] == reg[instr->ri.r0]) if (reg[instr->ri.rs] == reg[instr->ri.r0])
cpu_set_pc(pc + instr->ri.offset); cpu_set_pc(pc + instr->ri.offset);
break; break;
case OP_SYSC_WR : case OP_INT :
debug("I/O write r%i: %i\n", instr->r.rs, reg[instr->r.rs]); debug("int %i(#%i)\n", instr->r.rs, instr->i.imm);
syscall_write(reg[instr->i.rs], instr->i.imm); vm_syscall(instr->i.rs, instr->i.imm, reg);
break; break;
default : default :
fprintf(stderr, "Invalid instruction (%.2X)\n", instr->opcode); fprintf(stderr, "Invalid instruction (%.2X)\n", instr->opcode);