aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/cpu.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cpu.rs b/src/cpu.rs
index 124d391..b28fef9 100644
--- a/src/cpu.rs
+++ b/src/cpu.rs
@@ -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;
}
-
}