1
0
mirror of https://github.com/rkujawa/rk65c02.git synced 2025-01-20 09:32:42 +00:00

Add test case for ASL.

This commit is contained in:
Radosław Kujawa 2018-03-28 13:18:44 +02:00
parent 9ff0cb26fc
commit 0b2be69481
2 changed files with 36 additions and 0 deletions

View File

@ -542,6 +542,34 @@ ATF_TC_BODY(emul_and, tc)
bus_finish(&b);
}
ATF_TC_WITHOUT_HEAD(emul_asl);
ATF_TC_BODY(emul_asl, tc)
{
rk65c02emu_t e;
bus_t b;
b = bus_init_with_default_devs();
e = rk65c02_init(&b);
e.regs.A = 0xAA;
e.regs.X = 0x1;
bus_write_1(&b, 0x10, 0xAA);
bus_write_1(&b, 0x11, 0xAA);
bus_write_1(&b, 0x300, 0xFF);
bus_write_1(&b, 0x301, 0xFF);
ATF_REQUIRE(rom_start(&e, "test_emulation_asl.rom", tc));
ATF_CHECK(e.regs.A == 0x54);
ATF_CHECK(bus_read_1(&b, 0x10) == 0x54);
ATF_CHECK(bus_read_1(&b, 0x11) == 0x54);
ATF_CHECK(bus_read_1(&b, 0x300) == 0xFE);
ATF_CHECK(bus_read_1(&b, 0x301) == 0xFE);
ATF_CHECK(e.regs.P & P_CARRY);
bus_finish(&b);
}
ATF_TC_WITHOUT_HEAD(emul_nop);
ATF_TC_BODY(emul_nop, tc)
{
@ -1351,6 +1379,7 @@ ATF_TC_BODY(emul_smb, tc)
ATF_TP_ADD_TCS(tp)
{
ATF_TP_ADD_TC(tp, emul_and);
ATF_TP_ADD_TC(tp, emul_asl);
ATF_TP_ADD_TC(tp, emul_adc_16bit);
ATF_TP_ADD_TC(tp, emul_adc_bcd);
ATF_TP_ADD_TC(tp, emul_bit);

View File

@ -0,0 +1,7 @@
start: asl A
asl 0x10
asl 0x10,X
asl 0x300
asl 0x300,X
stp