From 8b3c9f8ad27b817ccfbef7f1a4cca6ac7150b9ea Mon Sep 17 00:00:00 2001 From: Andrew Keeton Date: Thu, 13 Nov 2014 18:42:07 -0500 Subject: [PATCH] Add branch_if_overflow_clear(). --- src/machine.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/machine.rs b/src/machine.rs index a9d3eb6..2b44330 100644 --- a/src/machine.rs +++ b/src/machine.rs @@ -595,6 +595,12 @@ impl Machine { } } + fn branch_if_overflow_clear(&mut self, addr: Address) { + if !self.registers.status.contains(PS_OVERFLOW) { + self.registers.program_counter = addr; + } + } + fn push_on_stack(&mut self, val: u8) { let addr = self.registers.stack_pointer.to_address(); self.memory.set_byte(addr, val);