From 413d063f8226865aa7dcf76fc2872e2703504139 Mon Sep 17 00:00:00 2001 From: Andrew Keeton Date: Thu, 6 Nov 2014 19:07:54 -0500 Subject: [PATCH] Add and(). --- src/machine.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/machine.rs b/src/machine.rs index e322160..e7b6cac 100644 --- a/src/machine.rs +++ b/src/machine.rs @@ -459,6 +459,11 @@ impl Machine { } } + fn and(&mut self, value: i8) { + let a_after = self.registers.accumulator & value; + self.load_accumulator(a_after); + } + // TODO: Implement binary-coded decimal fn subtract_with_carry(&mut self, value: i8) { if self.registers.status.contains(PS_DECIMAL_MODE) {