From c9f59dca603c1cba6e6a1d019740f3a6fd65a2ab Mon Sep 17 00:00:00 2001 From: Andrew Keeton Date: Thu, 6 Nov 2014 19:17:38 -0500 Subject: [PATCH] Add AND to execute_instruction. --- src/machine.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/machine.rs b/src/machine.rs index 374ace4..e95411d 100644 --- a/src/machine.rs +++ b/src/machine.rs @@ -88,6 +88,14 @@ impl Machine { self.add_with_carry(val); } + (instruction::AND, instruction::UseImmediate(val)) => { + self.and(val as i8); + } + (instruction::AND, instruction::UseAddress(addr)) => { + let val = self.memory.get_byte(addr) as i8; + self.and(val as i8); + } + (instruction::ASL, instruction::UseImplied) => { // Accumulator mode let mut val = self.registers.accumulator as u8;