mirror of
https://github.com/pevans/erc-c.git
synced 2025-01-03 00:29:38 +00:00
Try to match technical behavior described for JSR/RTS
This commit is contained in:
parent
0581ed6b44
commit
5f93bdae25
@ -37,7 +37,7 @@ DEFINE_INST(jmp)
|
|||||||
*/
|
*/
|
||||||
DEFINE_INST(jsr)
|
DEFINE_INST(jsr)
|
||||||
{
|
{
|
||||||
vm_16bit pc3 = cpu->PC + 3;
|
vm_16bit pc3 = cpu->PC + 2;
|
||||||
|
|
||||||
mos6502_push_stack(cpu, pc3 >> 8);
|
mos6502_push_stack(cpu, pc3 >> 8);
|
||||||
mos6502_push_stack(cpu, pc3 & 0xff);
|
mos6502_push_stack(cpu, pc3 & 0xff);
|
||||||
@ -72,4 +72,5 @@ DEFINE_INST(rts)
|
|||||||
{
|
{
|
||||||
cpu->PC = mos6502_pop_stack(cpu);
|
cpu->PC = mos6502_pop_stack(cpu);
|
||||||
cpu->PC |= mos6502_pop_stack(cpu) << 8;
|
cpu->PC |= mos6502_pop_stack(cpu) << 8;
|
||||||
|
cpu->PC++;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user