1
0
mirror of https://github.com/pevans/erc-c.git synced 2024-12-21 23:29:16 +00:00
erc-c/src/mos6502.exec.c
2017-12-02 13:05:53 -06:00

40 lines
483 B
C

/*
* mos6502.exec.c
*/
#include "mos6502.h"
#include "mos6502.enums.h"
DEFINE_INST(brk)
{
cpu->P |= INTERRUPT;
mos6502_push_stack(cpu, cpu->PC);
cpu->PC += 2;
}
DEFINE_INST(jmp)
{
cpu->PC = cpu->last_addr;
}
DEFINE_INST(jsr)
{
mos6502_push_stack(cpu, cpu->PC + 2);
cpu->PC = cpu->last_addr;
}
DEFINE_INST(nop)
{
// do nothing
}
DEFINE_INST(rti)
{
cpu->PC = mos6502_pop_stack(cpu);
}
DEFINE_INST(rts)
{
cpu->PC = mos6502_pop_stack(cpu);
}