summaryrefslogtreecommitdiff
path: root/src/chip8.rs
diff options
context:
space:
mode:
authorSamuel Perrouault <samuel.perrouault@gmail.com>2025-03-26 11:48:11 +0100
committerSamuel Perrouault <samuel.perrouault@gmail.com>2025-03-26 11:48:11 +0100
commit31007cfa8e7e31b356268ddfb74119f13f985122 (patch)
tree454b9faaf6350b00607aba9ae7a938f4d82587ef /src/chip8.rs
parent1782b338364149bef81871fcb8418db7ab6d18fb (diff)
handle JP instruction
Diffstat (limited to 'src/chip8.rs')
-rw-r--r--src/chip8.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/chip8.rs b/src/chip8.rs
index e372367..56f111c 100644
--- a/src/chip8.rs
+++ b/src/chip8.rs
@@ -63,6 +63,11 @@ impl Chip8 {
}
_ => unknown_opcode(opcode),
},
+ 0x1000 => {
+ let addr = opcode & 0x0FFF;
+ eprintln!("JP {}", addr);
+ self.pc = addr;
+ }
0x6000 => {
let x = (opcode & 0x0F00) >> 8;
let value = opcode & 0x00FF;