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:
parent
fa30f39d55
commit
bae062cbf9
1 changed files with 3 additions and 3 deletions
|
|
@ -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);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue