1
0
mirror of https://github.com/mre/mos6502.git synced 2024-12-01 11:51:51 +00:00

Add AND to execute_instruction.

This commit is contained in:
Andrew Keeton 2014-11-06 19:17:38 -05:00
parent 198ddc3131
commit c9f59dca60

View File

@ -88,6 +88,14 @@ impl Machine {
self.add_with_carry(val); 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) => { (instruction::ASL, instruction::UseImplied) => {
// Accumulator mode // Accumulator mode
let mut val = self.registers.accumulator as u8; let mut val = self.registers.accumulator as u8;