mirror of
https://github.com/mre/mos6502.git
synced 2024-12-03 08:51:41 +00:00
Add branch_if_carry_set_test().
This commit is contained in:
parent
8c0e4949a9
commit
eb5c3f3c2a
@ -886,6 +886,19 @@ fn branch_if_carry_clear_test() {
|
|||||||
assert_eq!(machine.registers.program_counter, Address(0xABCD));
|
assert_eq!(machine.registers.program_counter, Address(0xABCD));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn branch_if_carry_set_test() {
|
||||||
|
let mut machine = Machine::new();
|
||||||
|
|
||||||
|
machine.execute_instruction((instruction::CLC, instruction::UseImplied));
|
||||||
|
machine.branch_if_carry_set(Address(0xABCD));
|
||||||
|
assert_eq!(machine.registers.program_counter, Address(0));
|
||||||
|
|
||||||
|
machine.execute_instruction((instruction::SEC, instruction::UseImplied));
|
||||||
|
machine.branch_if_carry_set(Address(0xABCD));
|
||||||
|
assert_eq!(machine.registers.program_counter, Address(0xABCD));
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn branch_if_minus_test() {
|
fn branch_if_minus_test() {
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user