Crate vm6502

Source
Expand description

6502 virtual machine implementation.

This crate provides a virtual machine for the 6502 CPU.

It is designed to be used as a library, with no frontend.

§Virtual machine

The virtual machine is implemented as a struct, VirtualMachine, which contains all the state of the machine. The state is stored in a flat array, which is indexed by the Registers struct.

§Specifications

§Registers

THere are 8 status flags, stored in the registers.

S/N: The B flag is not actually set on the real 6502 status register, instead it’s configured in memory when it’s pushed and pulled. (Presumably during BRK)

§Flags

§Memory

The VirtualMachine has a flat memory map which the stack and heap index into.

§Addressing modes

§Instruction set

Instructions

§Macros

Several macros are provided for more easily interacting with the machine and wielding opcodes. See more.

§!! In construction !!

Also provided is an assembler and a programmer.

Modules§

assembler
High performance 6502 assembler.
prelude
program
utils
vm

Macros§

check_page_cross
make_status
Make an arbitrary state from flags.
opcode
Macro to get the value of an opcode from its name.
opcode_name
Macro to get the name of an opcode from its value.
status
Convert Status to binary flag.
stuff_program_at_end