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

src/cpu.c: implement JR instruction

This commit is contained in:
Henrik Hautakoski 2018-10-28 13:27:21 +01:00
parent 1eef46cc5e
commit 900e1d87c4
No known key found for this signature in database
GPG key ID: 839F3A7EAFAEAFAA

View file

@ -79,7 +79,8 @@ static void execute(struct instr *instr) {
cpu_set_pc(instr->j.addr);
break;
case OP_JR :
debug("jr\t#r%i(#%i)\n", instr->i.rs, instr->i.imm);
debug("jr\tr%i(#%i)\n", instr->i.rs, instr->i.imm);
cpu_set_pc(reg[instr->r.rs] + instr->i.imm);
break;
case OP_BEQ :
debug("beq\tr%i r%i #%i\n", instr->ri.rs, instr->ri.r0, instr->ri.offset);