1
0
mirror of https://github.com/rkujawa/rk65c02.git synced 2024-12-22 15:31:12 +00:00

Add missing test cases for STZ.

This commit is contained in:
Radosław Kujawa 2019-01-05 23:57:18 +01:00
parent 69fb59ee41
commit 84f4c530d8
4 changed files with 27 additions and 1 deletions

View File

@ -472,11 +472,28 @@ ATF_TC_BODY(emul_stz, tc)
b = bus_init_with_default_devs();
e = rk65c02_init(&b);
/* STZ zp */
/* STZ zero page */
bus_write_1(&b, 0x10, 0xAA);
ATF_REQUIRE(rom_start(&e, "test_emulation_stz_zp.rom", tc));
ATF_CHECK(bus_read_1(&b, 0x10) == 0x00);
/* STZ zero page X */
bus_write_1(&b, 0x15, 0x55);
e.regs.X = 0x4;
ATF_REQUIRE(rom_start(&e, "test_emulation_stz_zpx.rom", tc));
ATF_CHECK(bus_read_1(&b, 0x15) == 0x00);
/* STZ absolute */
bus_write_1(&b, 0x2000, 0xAA);
ATF_REQUIRE(rom_start(&e, "test_emulation_stz_abs.rom", tc));
ATF_CHECK(bus_read_1(&b, 0x2000) == 0x00);
/* STZ absolute X */
bus_write_1(&b, 0x2005, 0x55);
e.regs.X = 0x1;
ATF_REQUIRE(rom_start(&e, "test_emulation_stz_absx.rom", tc));
ATF_CHECK(bus_read_1(&b, 0x2005) == 0x00);
bus_finish(&b);
}

View File

@ -0,0 +1,3 @@
start: stz 0x2000
stp

View File

@ -0,0 +1,3 @@
start: stz 0x2004,X
stp

View File

@ -0,0 +1,3 @@
start: stz 0x11,X
stp