v6502
The MOS 6502 Virtual Machine and Toolchain Infrastructure
Functions
Instruction Execution

Functions

int v6502_instructionLengthForOpcode (v6502_opcode opcode)
 Return the byte-length of an instruction based on the opcode (See: Karnaugh Map Analysis)
 
v6502_address_mode v6502_addressModeForOpcode (v6502_opcode opcode)
 Return the v6502_address_mode of an instruction based on the opcode (See: Karnaugh Map Analysis)
 
void v6502_execute (v6502_cpu *cpu, uint8_t opcode, uint8_t low, uint8_t high)
 Execute an instruction on a v6502_cpu. More...
 
void v6502_step (v6502_cpu *cpu)
 Single step a v6502_cpu.
 
void v6502_reset (v6502_cpu *cpu)
 Hardware reset a v6502_cpu.
 
void v6502_nmi (v6502_cpu *cpu)
 Send an NMI to a v6502_cpu.
 

Detailed Description

Function Documentation

◆ v6502_execute()

void v6502_execute ( v6502_cpu cpu,
uint8_t  opcode,
uint8_t  low,
uint8_t  high 
)

Execute an instruction on a v6502_cpu.

It is important to note that this does not alter the program counter, v6502_step is required in order for that to happen. This is because some operations (like the interrupt sequence) actually inject instructions directly into the cpu, mid-execution.

Todo:
TODO: Should this prevent the automatic pc shift?

TODO:

Todo:
Interrupts (RTI/RTS)

[eor]

[eor]

[jmp]

[jmp]

[lda]

[lda]

[ldx]

[ldx]

[ldy]

[ldy]

[sbc]

[sbc]

[sta]

[sta]

[stx]

[stx]

[sty]

[sty]