Add test cases for LDA addressing modes absolute X, absolute Y.

This commit is contained in:
Radosław Kujawa 2017-01-23 16:33:03 +01:00
parent 342a188314
commit 09f0a828e3
4 changed files with 19 additions and 0 deletions

View File

@ -14,6 +14,7 @@ TESTROMS=test_emulation_and_imm.rom \
test_emulation_nop.rom \
test_emulation_lda_imm.rom test_emulation_lda_zp.rom \
test_emulation_lda_abs.rom \
test_emulation_lda_absx.rom test_emulation_lda_absy.rom \
test_emulation_stz_zp.rom
all : $(TESTS) $(TESTROMS)

View File

@ -105,6 +105,18 @@ ATF_TC_BODY(emul_lda, tc)
ATF_REQUIRE(rom_start(&e, "test_emulation_lda_abs.rom"));
ATF_CHECK(e.regs.A == 0xEA);
/* LDA absolute X */
bus_write_1(&b, 0x2F5A, 0xEB);
e.regs.X = 0x5A;
ATF_REQUIRE(rom_start(&e, "test_emulation_lda_absx.rom"));
ATF_CHECK(e.regs.A == 0xEB);
/* LDA absolute X */
bus_write_1(&b, 0x2F5E, 0xEC);
e.regs.Y = 0x5E;
ATF_REQUIRE(rom_start(&e, "test_emulation_lda_absy.rom"));
ATF_CHECK(e.regs.A == 0xEC);
bus_finish(&b);
}

View File

@ -0,0 +1,3 @@
start: lda 0x2F00,X
stp

View File

@ -0,0 +1,3 @@
start: lda 0x2F00,Y
stp