From b7cc5cd2348748c277fdbd732cdb38ba37291755 Mon Sep 17 00:00:00 2001 From: Andrew Keeton Date: Sun, 16 Nov 2014 21:20:42 -0500 Subject: [PATCH] Add exclusive_or(). --- src/machine.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/machine.rs b/src/machine.rs index 8b23bbf..94d2c24 100644 --- a/src/machine.rs +++ b/src/machine.rs @@ -696,6 +696,11 @@ impl Machine { self.compare(y, val); } + fn exclusive_or(&mut self, val: u8) { + let a_after = self.registers.accumulator ^ (val as i8); + self.load_accumulator(a_after); + } + fn push_on_stack(&mut self, val: u8) { let addr = self.registers.stack_pointer.to_address(); self.memory.set_byte(addr, val);