mirror of
https://github.com/rkujawa/rk65c02.git
synced 2024-12-22 15:31:12 +00:00
Add STZ emulation.
This commit is contained in:
parent
86c9c6414c
commit
c7633feb87
@ -99,7 +99,7 @@ OP_RTS,"rts",IMPLIED,1,NULL
|
||||
OP_ADC_IZPX,"adc",IZPX,2,NULL
|
||||
OP_NOPI_63,"nop",IMMEDIATE,2,NULL
|
||||
OP_NOPI_64,"nop",IMPLIED,1,NULL
|
||||
OP_STZ_ZP,"stz",ZP,2,NULL
|
||||
OP_STZ_ZP,"stz",ZP,2,emul_stz
|
||||
OP_ADC_ZP,"adc",ZP,2,NULL
|
||||
OP_ROR_ZP,"ror",ZP,2,NULL
|
||||
OP_RMB6_ZP,"rmb6",ZP,2,NULL
|
||||
|
|
@ -63,3 +63,14 @@ emul_stp(rk65c02emu_t *e, instruction_t *i)
|
||||
e->state = STOPPED;
|
||||
}
|
||||
|
||||
/* STZ - store zero */
|
||||
void
|
||||
emul_stz(rk65c02emu_t *e, instruction_t *i)
|
||||
{
|
||||
instrdef_t id;
|
||||
|
||||
id = instruction_decode(i->opcode);
|
||||
|
||||
instruction_data_write_1(e, &id, i, 0);
|
||||
}
|
||||
|
||||
|
@ -8,7 +8,8 @@ TESTS=test_bus test_emulation
|
||||
TESTROMS=test_emulation_and_imm.rom \
|
||||
test_emulation_pha.rom test_emulation_pla.rom \
|
||||
test_emulation_nop.rom \
|
||||
test_emulation_lda_imm.rom test_emulation_lda_zp.rom
|
||||
test_emulation_lda_imm.rom test_emulation_lda_zp.rom \
|
||||
test_emulation_stz_zp.rom
|
||||
|
||||
all : $(TESTS) $(TESTROMS)
|
||||
|
||||
|
@ -45,6 +45,23 @@ ATF_TC_BODY(emul_lda, tc)
|
||||
bus_finish(&b);
|
||||
}
|
||||
|
||||
ATF_TC_WITHOUT_HEAD(emul_stz);
|
||||
ATF_TC_BODY(emul_stz, tc)
|
||||
{
|
||||
rk65c02emu_t e;
|
||||
bus_t b;
|
||||
|
||||
b = bus_init();
|
||||
e = rk65c02_init(&b);
|
||||
|
||||
/* STZ zp */
|
||||
bus_write_1(&b, 0x10, 0xAA);
|
||||
ATF_REQUIRE(rom_start(&e, "test_emulation_stz_zp.rom"));
|
||||
ATF_CHECK(bus_read_1(&b, 0x10) == 0x00);
|
||||
|
||||
bus_finish(&b);
|
||||
}
|
||||
|
||||
ATF_TC_WITHOUT_HEAD(emul_and);
|
||||
ATF_TC_BODY(emul_and, tc)
|
||||
{
|
||||
@ -134,6 +151,8 @@ ATF_TP_ADD_TCS(tp)
|
||||
ATF_TP_ADD_TC(tp, emul_and);
|
||||
ATF_TP_ADD_TC(tp, emul_lda);
|
||||
ATF_TP_ADD_TC(tp, emul_nop);
|
||||
ATF_TP_ADD_TC(tp, emul_stz);
|
||||
|
||||
ATF_TP_ADD_TC(tp, emul_stack);
|
||||
|
||||
return (atf_no_error());
|
||||
|
3
test/test_emulation_stz_zp.s
Normal file
3
test/test_emulation_stz_zp.s
Normal file
@ -0,0 +1,3 @@
|
||||
start: stz 0x10
|
||||
stp
|
||||
|
Loading…
Reference in New Issue
Block a user