mirror of
https://github.com/rkujawa/rk65c02.git
synced 2024-12-22 15:31:12 +00:00
Add emulation and test for CLV instruction.
This commit is contained in:
parent
f66e986cef
commit
ee66f9c78c
@ -183,7 +183,7 @@ OP_LDY_ZPX,"ldy",ZPX,2,emul_ldy,false
|
||||
OP_LDA_ZPX,"lda",ZPX,2,emul_lda,false
|
||||
OP_LDX_ZPY,"ldx",ZPY,1,emul_ldx,false
|
||||
OP_SMB3_ZP,"smb3",ZP,2,NULL,false
|
||||
OP_CLV,"clv",IMPLIED,1,NULL,false
|
||||
OP_CLV,"clv",IMPLIED,1,emul_clv,false
|
||||
OP_LDA_ABSY,"lda",ABSOLUTEY,3,emul_lda,false
|
||||
OP_TSX,"tsx",IMPLIED,1,emul_tsx,false
|
||||
OP_NOPI_BC,"nop",IMPLIED,1,NULL,false
|
||||
|
|
@ -72,6 +72,13 @@ emul_clc(rk65c02emu_t *e, void *id, instruction_t *i)
|
||||
e->regs.P &= ~P_CARRY;
|
||||
}
|
||||
|
||||
/* CLV - clear overflow flag */
|
||||
void
|
||||
emul_clv(rk65c02emu_t *e, void *id, instruction_t *i)
|
||||
{
|
||||
e->regs.P &= ~P_SIGN_OVERFLOW;
|
||||
}
|
||||
|
||||
/* DEC - decrement memory location/acumulator */
|
||||
void
|
||||
emul_dec(rk65c02emu_t *e, void *id, instruction_t *i)
|
||||
|
@ -287,6 +287,23 @@ ATF_TC_BODY(emul_stz, tc)
|
||||
bus_finish(&b);
|
||||
}
|
||||
|
||||
ATF_TC_WITHOUT_HEAD(emul_clv);
|
||||
ATF_TC_BODY(emul_clv, tc)
|
||||
{
|
||||
rk65c02emu_t e;
|
||||
bus_t b;
|
||||
|
||||
b = bus_init();
|
||||
e = rk65c02_init(&b);
|
||||
|
||||
e.regs.P |= P_SIGN_OVERFLOW;
|
||||
/* CLV */
|
||||
ATF_REQUIRE(rom_start(&e, "test_emulation_clv.rom", tc));
|
||||
ATF_CHECK(e.regs.P ^ P_SIGN_OVERFLOW);
|
||||
|
||||
bus_finish(&b);
|
||||
}
|
||||
|
||||
ATF_TC_WITHOUT_HEAD(emul_clc_sec);
|
||||
ATF_TC_BODY(emul_clc_sec, tc)
|
||||
{
|
||||
@ -665,6 +682,7 @@ ATF_TP_ADD_TCS(tp)
|
||||
ATF_TP_ADD_TC(tp, emul_dec);
|
||||
ATF_TP_ADD_TC(tp, emul_dex_dey);
|
||||
ATF_TP_ADD_TC(tp, emul_clc_sec);
|
||||
ATF_TP_ADD_TC(tp, emul_clv);
|
||||
ATF_TP_ADD_TC(tp, emul_inc);
|
||||
ATF_TP_ADD_TC(tp, emul_inx_iny);
|
||||
ATF_TP_ADD_TC(tp, emul_jmp);
|
||||
|
3
test/test_emulation_clv.s
Normal file
3
test/test_emulation_clv.s
Normal file
@ -0,0 +1,3 @@
|
||||
start: clv
|
||||
stp
|
||||
|
Loading…
Reference in New Issue
Block a user