mirror of
https://github.com/mre/mos6502.git
synced 2024-11-28 22:51:26 +00:00
Add branch_if_overflow_clear_test().
This commit is contained in:
parent
b57a946f6a
commit
4ffae406d6
@ -981,3 +981,16 @@ fn branch_if_positive_test() {
|
||||
machine.branch_if_positive(Address(0xABCD));
|
||||
assert_eq!(machine.registers.program_counter, Address(0xABCD));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn branch_if_overflow_clear_test() {
|
||||
let mut machine = Machine::new();
|
||||
|
||||
machine.registers.status.insert(PS_OVERFLOW);
|
||||
machine.branch_if_overflow_clear(Address(0xABCD));
|
||||
assert_eq!(machine.registers.program_counter, Address(0));
|
||||
|
||||
machine.registers.status.remove(PS_OVERFLOW);
|
||||
machine.branch_if_overflow_clear(Address(0xABCD));
|
||||
assert_eq!(machine.registers.program_counter, Address(0xABCD));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user