Commit Diff


commit - 1330705f656258baa1b66d240e18e73f0a38165d
commit + 99fe3efb3ea80a426968ccbb29a2e513727e7e83
blob - fbf9504c5f31fd5faa20fdb5b342632d1ba86825
blob + 2626728f30bab72976e1f8c69674f6525d317daf
--- src/chip8.rs
+++ src/chip8.rs
@@ -50,6 +50,15 @@ impl Chip8 {
             0x00E0 => {
                 self.video_driver.clear();
             },
+            // RET
+            0x00EE => {
+                self.pc = match self.stack.pop() {
+                    Some(s) => s,
+                    None => {
+                        return Err(format!("pop from empty stack"));
+                    }
+                };
+            },
             _ => {
                 return Err(format!("{:#06x}: not an instruction", instruction));
             }