1
0
mirror of https://github.com/mre/mos6502.git synced 2024-11-25 02:33:26 +00:00

Add branch_if_overflow_clear().

This commit is contained in:
Andrew Keeton 2014-11-13 18:42:07 -05:00
parent 4ffae406d6
commit 8b3c9f8ad2

View File

@ -595,6 +595,12 @@ impl Machine {
} }
} }
fn branch_if_overflow_clear(&mut self, addr: Address) {
if !self.registers.status.contains(PS_OVERFLOW) {
self.registers.program_counter = addr;
}
}
fn push_on_stack(&mut self, val: u8) { fn push_on_stack(&mut self, val: u8) {
let addr = self.registers.stack_pointer.to_address(); let addr = self.registers.stack_pointer.to_address();
self.memory.set_byte(addr, val); self.memory.set_byte(addr, val);