1
0
mirror of https://github.com/rkujawa/rk65c02.git synced 2024-12-04 04:51:27 +00:00

Add tests for STY.

This commit is contained in:
Radosław Kujawa 2019-01-07 11:43:23 +01:00
parent b39663db42
commit 9bcbeb3ca7
4 changed files with 35 additions and 0 deletions

View File

@ -766,6 +766,31 @@ ATF_TC_BODY(emul_sta, tc)
bus_finish(&b);
}
ATF_TC_WITHOUT_HEAD(emul_sty);
ATF_TC_BODY(emul_sty, tc)
{
rk65c02emu_t e;
bus_t b;
b = bus_init_with_default_devs();
e = rk65c02_init(&b);
/* STY zero page */
e.regs.Y = 0xAA;
ATF_REQUIRE(rom_start(&e, "test_emulation_sty_zp.rom", tc));
ATF_CHECK(bus_read_1(&b, 0x20) == 0xAA);
/* STY zero page X */
e.regs.Y = 0x55;
e.regs.X = 0x1;
ATF_REQUIRE(rom_start(&e, "test_emulation_sty_zpx.rom", tc));
ATF_CHECK(bus_read_1(&b, 0x20) == 0x55);
/* STY absolute */
e.regs.Y = 0xAA;
ATF_REQUIRE(rom_start(&e, "test_emulation_sty_abs.rom", tc));
ATF_CHECK(bus_read_1(&b, 0x2010) == 0xAA);
}
ATF_TC_WITHOUT_HEAD(emul_ora);
ATF_TC_BODY(emul_ora, tc)
{
@ -1747,6 +1772,7 @@ ATF_TP_ADD_TCS(tp)
ATF_TP_ADD_TC(tp, emul_stack);
ATF_TP_ADD_TC(tp, emul_txa_tya_tax_tay);
ATF_TP_ADD_TC(tp, emul_sta);
ATF_TP_ADD_TC(tp, emul_sty);
ATF_TP_ADD_TC(tp, emul_sbc);
ATF_TP_ADD_TC(tp, emul_sbc_16bit);
ATF_TP_ADD_TC(tp, emul_sbc_bcd);

View File

@ -0,0 +1,3 @@
start: sty 0x2010
stp

View File

@ -0,0 +1,3 @@
start: sty 0x20
stp

View File

@ -0,0 +1,3 @@
start: sty 0x1F,X
stp