From be7539d6c92f7d9a2d1b62e8bc9f2bd9687656c9 Mon Sep 17 00:00:00 2001 From: Andrew Keeton Date: Thu, 6 Nov 2014 19:32:15 -0500 Subject: [PATCH] Add branch_if_carry_clear(). --- src/machine.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/machine.rs b/src/machine.rs index 6175778..73f5596 100644 --- a/src/machine.rs +++ b/src/machine.rs @@ -541,6 +541,12 @@ impl Machine { self.registers.program_counter = addr; } + fn branch_if_carry_clear(&mut self, addr: Address) { + if !self.registers.status.contains(PS_CARRY) { + self.registers.program_counter = addr; + } + } + fn branch_if_minus(&mut self, addr: Address) { if self.registers.status.contains(PS_NEGATIVE) { self.registers.program_counter = addr;