1
0
mirror of https://github.com/rkujawa/rk65c02.git synced 2024-12-12 10:30:23 +00:00

Add STA, STY, STX emulation.

This commit is contained in:
Radosław Kujawa 2017-01-23 15:02:21 +01:00
parent ee8a16a5ba
commit f9708ca049
2 changed files with 35 additions and 14 deletions

View File

@ -128,35 +128,35 @@ OP_ADC_ABSX,"adc",ABSOLUTEX,3,NULL
OP_ROR_ABSX,"ror",ABSOLUTEX,3,NULL OP_ROR_ABSX,"ror",ABSOLUTEX,3,NULL
OP_BBR7_REL,"bbr7",ZPR,2,NULL OP_BBR7_REL,"bbr7",ZPR,2,NULL
OP_BRA_REL,"bra",RELATIVE,2,NULL OP_BRA_REL,"bra",RELATIVE,2,NULL
OP_STA_IZPX,"sta",IZPX,2,NULL OP_STA_IZPX,"sta",IZPX,2,emul_sta
OP_NOPI_83,"nop",IMMEDIATE,2,NULL OP_NOPI_83,"nop",IMMEDIATE,2,NULL
OP_NOPI_84,"nop",IMPLIED,1,NULL OP_NOPI_84,"nop",IMPLIED,1,NULL
OP_STY_ZP,"sty",ZP,2,NULL OP_STY_ZP,"sty",ZP,2,emul_sty
OP_STA_ZP,"sta",ZP,2,NULL OP_STA_ZP,"sta",ZP,2,emul_sta
OP_STX_ZP,"stx",ZP,2,NULL OP_STX_ZP,"stx",ZP,2,emul_stx
OP_SMB0_ZP,"smb0",ZP,2,NULL OP_SMB0_ZP,"smb0",ZP,2,NULL
OP_DEY,"dey",IMPLIED,1,emul_dey OP_DEY,"dey",IMPLIED,1,emul_dey
OP_BIT_IMM,"bit",IMMEDIATE,2,NULL OP_BIT_IMM,"bit",IMMEDIATE,2,NULL
OP_TXA,"txa",IMPLIED,1,emul_txa OP_TXA,"txa",IMPLIED,1,emul_txa
OP_NOPI_8C,"nop",IMPLIED,1,NULL OP_NOPI_8C,"nop",IMPLIED,1,NULL
OP_STY_ABS,"sty",ABSOLUTE,3,NULL OP_STY_ABS,"sty",ABSOLUTE,3,emul_sty
OP_STA_ABS,"sta",ABSOLUTE,3,NULL OP_STA_ABS,"sta",ABSOLUTE,3,emul_sta
OP_STX_ABS,"stx",ABSOLUTE,3,NULL OP_STX_ABS,"stx",ABSOLUTE,3,emul_stx
OP_BBS0_REL,"bbs0",ZPR,2,NULL OP_BBS0_REL,"bbs0",ZPR,2,NULL
OP_BCC_REL,"bcc",RELATIVE,2,NULL OP_BCC_REL,"bcc",RELATIVE,2,NULL
OP_STA_IZPY,"sta",IZPY,2,NULL OP_STA_IZPY,"sta",IZPY,2,emul_sta
OP_STA_IZP,"sta",IZP,2,NULL OP_STA_IZP,"sta",IZP,2,emul_sta
OP_NOPI_94,"nop",IMPLIED,1,NULL OP_NOPI_94,"nop",IMPLIED,1,NULL
OP_STY_ZPX,"sty",ZPX,2,NULL OP_STY_ZPX,"sty",ZPX,2,emul_sty
OP_STA_ZPX,"sta",ZPX,2,NULL OP_STA_ZPX,"sta",ZPX,2,emul_sta
OP_STX_ZPY,"stx",ZPY,2,NULL OP_STX_ZPY,"stx",ZPY,2,emul_stx
OP_SMB1_ZP,"smb1",ZP,2,NULL OP_SMB1_ZP,"smb1",ZP,2,NULL
OP_TYA,"tya",IMPLIED,1,emul_tya OP_TYA,"tya",IMPLIED,1,emul_tya
OP_STA_ABSY,"sta",ABSOLUTEY,3,NULL OP_STA_ABSY,"sta",ABSOLUTEY,3,emul_sta
OP_TXS,"txs",IMPLIED,1,emul_txs OP_TXS,"txs",IMPLIED,1,emul_txs
OP_NOPI_9C,"nop",IMPLIED,1,NULL OP_NOPI_9C,"nop",IMPLIED,1,NULL
OP_STZ_ABS,"stz",ABSOLUTE,3,emul_stz OP_STZ_ABS,"stz",ABSOLUTE,3,emul_stz
OP_STA_ABSX,"sta",ABSOLUTEX,3,NULL OP_STA_ABSX,"sta",ABSOLUTEX,3,emul_sta
OP_STZ_ABSX,"stz",ABSOLUTEX,3,emul_stz OP_STZ_ABSX,"stz",ABSOLUTEX,3,emul_stz
OP_BBS1_REL,"bbs1",ZPR,2,NULL OP_BBS1_REL,"bbs1",ZPR,2,NULL
OP_LDY_IMM,"ldy",IMMEDIATE,2,emul_ldy OP_LDY_IMM,"ldy",IMMEDIATE,2,emul_ldy

1 opcode_id mnemonic addressing size emulation
128 OP_ROR_ABSX ror ABSOLUTEX 3 NULL
129 OP_BBR7_REL bbr7 ZPR 2 NULL
130 OP_BRA_REL bra RELATIVE 2 NULL
131 OP_STA_IZPX sta IZPX 2 NULL emul_sta
132 OP_NOPI_83 nop IMMEDIATE 2 NULL
133 OP_NOPI_84 nop IMPLIED 1 NULL
134 OP_STY_ZP sty ZP 2 NULL emul_sty
135 OP_STA_ZP sta ZP 2 NULL emul_sta
136 OP_STX_ZP stx ZP 2 NULL emul_stx
137 OP_SMB0_ZP smb0 ZP 2 NULL
138 OP_DEY dey IMPLIED 1 emul_dey
139 OP_BIT_IMM bit IMMEDIATE 2 NULL
140 OP_TXA txa IMPLIED 1 emul_txa
141 OP_NOPI_8C nop IMPLIED 1 NULL
142 OP_STY_ABS sty ABSOLUTE 3 NULL emul_sty
143 OP_STA_ABS sta ABSOLUTE 3 NULL emul_sta
144 OP_STX_ABS stx ABSOLUTE 3 NULL emul_stx
145 OP_BBS0_REL bbs0 ZPR 2 NULL
146 OP_BCC_REL bcc RELATIVE 2 NULL
147 OP_STA_IZPY sta IZPY 2 NULL emul_sta
148 OP_STA_IZP sta IZP 2 NULL emul_sta
149 OP_NOPI_94 nop IMPLIED 1 NULL
150 OP_STY_ZPX sty ZPX 2 NULL emul_sty
151 OP_STA_ZPX sta ZPX 2 NULL emul_sta
152 OP_STX_ZPY stx ZPY 2 NULL emul_stx
153 OP_SMB1_ZP smb1 ZP 2 NULL
154 OP_TYA tya IMPLIED 1 emul_tya
155 OP_STA_ABSY sta ABSOLUTEY 3 NULL emul_sta
156 OP_TXS txs IMPLIED 1 emul_txs
157 OP_NOPI_9C nop IMPLIED 1 NULL
158 OP_STZ_ABS stz ABSOLUTE 3 emul_stz
159 OP_STA_ABSX sta ABSOLUTEX 3 NULL emul_sta
160 OP_STZ_ABSX stz ABSOLUTEX 3 emul_stz
161 OP_BBS1_REL bbs1 ZPR 2 NULL
162 OP_LDY_IMM ldy IMMEDIATE 2 emul_ldy

View File

@ -160,6 +160,27 @@ emul_stp(rk65c02emu_t *e, void *id, instruction_t *i)
e->state = STOPPED; e->state = STOPPED;
} }
/* STA - store accumulator */
void
emul_sta(rk65c02emu_t *e, void *id, instruction_t *i)
{
instruction_data_write_1(e, id, i, e->regs.A);
}
/* STX - store X */
void
emul_stx(rk65c02emu_t *e, void *id, instruction_t *i)
{
instruction_data_write_1(e, id, i, e->regs.X);
}
/* STY - store Y */
void
emul_sty(rk65c02emu_t *e, void *id, instruction_t *i)
{
instruction_data_write_1(e, id, i, e->regs.Y);
}
/* STZ - store zero */ /* STZ - store zero */
void void
emul_stz(rk65c02emu_t *e, void *id, instruction_t *i) emul_stz(rk65c02emu_t *e, void *id, instruction_t *i)