1
0
mirror of https://github.com/pevans/erc-c.git synced 2025-02-26 06:29:15 +00:00

We should be pushing and popping status

This commit is contained in:
Peter Evans 2017-12-08 23:24:58 -06:00
parent ccf16dd970
commit b0aa6d400a

View File

@ -16,6 +16,7 @@ DEFINE_INST(brk)
{ {
cpu->P |= INTERRUPT; cpu->P |= INTERRUPT;
mos6502_push_stack(cpu, cpu->PC); mos6502_push_stack(cpu, cpu->PC);
mos6502_push_stack(cpu, cpu->P);
cpu->PC += 2; cpu->PC += 2;
} }
@ -54,6 +55,7 @@ DEFINE_INST(nop)
*/ */
DEFINE_INST(rti) DEFINE_INST(rti)
{ {
cpu->P = mos6502_pop_stack(cpu);
cpu->PC = mos6502_pop_stack(cpu); cpu->PC = mos6502_pop_stack(cpu);
} }