1
0
mirror of https://github.com/pevans/erc-c.git synced 2024-11-23 23:32:45 +00:00

Test decimal mode with ADC

This commit is contained in:
Peter Evans 2018-02-26 20:02:58 -06:00
parent 30c07df9cb
commit 0333e308e7

View File

@ -15,6 +15,12 @@ Test(mos6502_arith, adc)
cpu->P &= ~MOS_CARRY; cpu->P &= ~MOS_CARRY;
mos6502_handle_adc(cpu, 64); mos6502_handle_adc(cpu, 64);
cr_assert_eq(cpu->A, 73); cr_assert_eq(cpu->A, 73);
// This should handle decimal mode without complaint
cpu->P |= MOS_DECIMAL;
cpu->A = 0x18;
mos6502_handle_adc(cpu, 0x3);
cr_assert_eq(cpu->A, 0x21);
} }
Test(mos6502_arith, adc_dec) Test(mos6502_arith, adc_dec)