From 26e2abe745652df161d38257065f876abb814256 Mon Sep 17 00:00:00 2001 From: Peter Evans Date: Mon, 26 Feb 2018 20:33:52 -0600 Subject: [PATCH] Test that ASL sets carry --- tests/mos6502.bits.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/mos6502.bits.c b/tests/mos6502.bits.c index 7885c27..8a45829 100644 --- a/tests/mos6502.bits.c +++ b/tests/mos6502.bits.c @@ -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);