From c4fbf6746a067eb1db7a836a52024539dde26af1 Mon Sep 17 00:00:00 2001 From: Sophie Forrest Date: Sat, 5 Oct 2024 01:38:15 +1300 Subject: feat: implement JSR instruction I decided to pull in byteorder to ease up some of the work here. Additionally, the test program has been modified, and I've added a todo for the LDR Absolute instruction. --- src/main.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 7f6df89..2fcee18 100644 --- a/src/main.rs +++ b/src/main.rs @@ -28,15 +28,21 @@ fn main() { // little program if let Some(opcode) = memory.data.get_mut(0xFFFC) { - *opcode = 0xA5; + *opcode = 0x20; } if let Some(opcode) = memory.data.get_mut(0xFFFD) { *opcode = 0x42; } - if let Some(opcode) = memory.data.get_mut(0x0042) { + if let Some(opcode) = memory.data.get_mut(0xFFFE) { + *opcode = 0x42; + } + if let Some(opcode) = memory.data.get_mut(0x4242) { + *opcode = 0xA9; + } + if let Some(opcode) = memory.data.get_mut(0x4243) { *opcode = 0x84; } // end program - cpu.execute(3, &memory); + cpu.execute(9, &mut memory); } -- cgit 1.4.1