From 3cbede06f890c6224b277ce55bb6e4f55992bc02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Kujawa?= Date: Mon, 23 Jan 2017 10:28:44 +0100 Subject: [PATCH] Add test for LDA with absolute addressing. --- test/Makefile | 1 + test/test_emulation.c | 5 +++++ test/test_emulation_lda_abs.s | 3 +++ 3 files changed, 9 insertions(+) create mode 100644 test/test_emulation_lda_abs.s diff --git a/test/Makefile b/test/Makefile index afcd293..2854abf 100644 --- a/test/Makefile +++ b/test/Makefile @@ -13,6 +13,7 @@ TESTROMS=test_emulation_and_imm.rom \ test_emulation_php.rom test_emulation_plp.rom \ test_emulation_nop.rom \ test_emulation_lda_imm.rom test_emulation_lda_zp.rom \ + test_emulation_lda_abs.rom \ test_emulation_stz_zp.rom all : $(TESTS) $(TESTROMS) diff --git a/test/test_emulation.c b/test/test_emulation.c index ebb5963..bd3668d 100644 --- a/test/test_emulation.c +++ b/test/test_emulation.c @@ -100,6 +100,11 @@ ATF_TC_BODY(emul_lda, tc) ATF_REQUIRE(rom_start(&e, "test_emulation_lda_zp.rom")); ATF_CHECK(e.regs.A == 0xAE); + /* LDA absolute */ + bus_write_1(&b, 0x2F5A, 0xEA); + ATF_REQUIRE(rom_start(&e, "test_emulation_lda_abs.rom")); + ATF_CHECK(e.regs.A == 0xEA); + bus_finish(&b); } diff --git a/test/test_emulation_lda_abs.s b/test/test_emulation_lda_abs.s new file mode 100644 index 0000000..14aac28 --- /dev/null +++ b/test/test_emulation_lda_abs.s @@ -0,0 +1,3 @@ +start: lda 0x2F5A + stp +