diff options
| author | krolxon <krolyxon@tutanota.com> | 2026-01-04 19:17:15 +0530 |
|---|---|---|
| committer | krolxon <krolyxon@tutanota.com> | 2026-01-04 19:17:15 +0530 |
| commit | 6e317ee063844780961a70b13a6aea73154ad72e (patch) | |
| tree | d3991aa272597f03427cfc5f6475d6b6a2c1d2ff | |
| parent | be61e5ae6bca45a6dafc46cfe0957a8db96f9e4c (diff) | |
mov instruction must set the zero flag appropriately to avoid desyncing
| -rw-r--r-- | src/cpu.rs | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -37,6 +37,8 @@ impl CPU { 3 => self.d = val, _ => {} } + + self.zero = val == 0; } pub fn add(&mut self, mem:&mut Memory) { @@ -150,7 +152,6 @@ impl CPU { if self.zero { self.pc = addrs; } - } pub fn jnz(&mut self, mem: &mut Memory) { @@ -162,7 +163,6 @@ impl CPU { if !self.zero { self.pc = addrs; } - } |
