mov instruction must set the zero flag appropriately to avoid desyncing

This commit is contained in:
krolxon 2026-01-04 19:17:15 +05:30
parent be61e5ae6b
commit 6e317ee063
1 changed files with 2 additions and 2 deletions

View File

@ -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;
}
}