Add BEQ to execute_instruction().

This commit is contained in:
Andrew Keeton 2014-11-06 19:50:35 -05:00
parent 8febc74788
commit a0ad2d47be
1 changed files with 6 additions and 0 deletions

View File

@ -122,6 +122,12 @@ impl Machine {
self.branch_if_carry_set(addr);
}
(instruction::BEQ, instruction::UseRelative(rel)) => {
let addr = self.registers.program_counter
+ AddressDiff(rel as i32);
self.branch_if_equal(addr);
}
(instruction::BIT, instruction::UseAddress(addr)) => {
let a: u8 = self.registers.accumulator as u8;
let m: u8 = self.memory.get_byte(addr);