toy6502

package module
v0.0.4-0...-d1060a3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 22, 2020 License: ISC Imports: 1 Imported by: 1

README

toy6502

Toy implementation of a 6502 CPU that passes Klaus Dormann's functional tests.

It does not do much beyond emulating the CPU at this time but this will be used later in other fun projects.

Documentation

Index

Constants

View Source
const (
	Negative   byte = 1 << 7 // N
	Overflow   byte = 1 << 6 // V
	Unused     byte = 1 << 5
	Break      byte = 1 << 4 // B
	BCD        byte = 1 << 3 // D
	Interrupts byte = 1 << 2 // I
	Zero       byte = 1 << 1 // Z
	Carry      byte = 1 << 0 // C
)

Variables

This section is empty.

Functions

func ExecuteInstruction

func ExecuteInstruction(c *CPU) bool

func GetA

func GetA(c *CPU) byte

func GetCycles

func GetCycles(c *CPU) uint64

func GetMemory

func GetMemory(c *CPU) []byte

func GetPC

func GetPC(c *CPU) uint16

func GetSP

func GetSP(c *CPU) byte

func GetSR

func GetSR(c *CPU) byte

func GetX

func GetX(c *CPU) byte

func GetY

func GetY(c *CPU) byte

func SetPC

func SetPC(c *CPU, newpc uint16)

Types

type CPU

type CPU struct {
	// contains filtered or unexported fields
}

func New

func New() *CPU

func (*CPU) Disassemble

func (c *CPU) Disassemble(address uint16) (string, byte)

disassemble disassembles an instruction at address and returns the instruction and bytes consumed.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL