1
0
mirror of https://github.com/pevans/erc-c.git synced 2024-12-11 17:50:50 +00:00

Test that ASL sets carry

This commit is contained in:
Peter Evans 2018-02-26 20:33:52 -06:00
parent 724dbb1577
commit 26e2abe745

View File

@ -22,6 +22,12 @@ Test(mos6502_bits, asl)
mos6502_handle_asl(cpu, 5);
cr_assert_eq(cpu->A, 10);
// Test if carry is set properly
cpu->P &= ~MOS_CARRY;
mos6502_handle_asl(cpu, 150);
cr_assert_eq(cpu->A, 44);
cr_assert_eq(cpu->P & MOS_CARRY, MOS_CARRY);
cpu->eff_addr = 123;
mos6502_handle_asl(cpu, 22);
cr_assert_eq(mos6502_get(cpu, 123), 44);