Skip to content

Commit

Permalink
support bnnn
Browse files Browse the repository at this point in the history
  • Loading branch information
190n committed May 17, 2024
1 parent d68460f commit b8ec109
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/tailfuncs.zig
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,9 @@ pub fn setI(cpu: *Cpu, decoded: Decoded.Int, pc: [*]Inst, i: [*]u8) void {

/// BNNN: jump to NNN + V0
pub fn jumpV0(cpu: *Cpu, decoded: Decoded.Int, pc: [*]Inst, i: [*]u8) void {
_ = i;
_ = pc;
_ = decoded;
std.debug.panic("jumpV0 at {x:0>3}", .{cpu.pc});
const new_pc = &cpu.code[Decoded.fromInt(decoded).nnn + cpu.v[0]];
cont(cpu, @ptrCast(new_pc), i, false);
}

/// CXNN: set VX to rand() & NN
Expand Down

0 comments on commit b8ec109

Please sign in to comment.