summary refs log tree commit diff
path: root/src/main.rs
diff options
context:
space:
mode:
authorSophie Forrest <git@sophieforrest.com>2024-10-05 01:38:15 +1300
committerSophie Forrest <git@sophieforrest.com>2024-10-05 01:38:15 +1300
commitc4fbf6746a067eb1db7a836a52024539dde26af1 (patch)
tree948c5812ebf6c4272c6cc0bc22f960d55775bd4c /src/main.rs
parent48ac2fa41c8da78cc4c26a5175476b972f1663da (diff)
feat: implement JSR instruction HEAD main
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.
Diffstat (limited to '')
-rw-r--r--src/main.rs12
1 files changed, 9 insertions, 3 deletions
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);
 }