disasm

package module
v0.0.0-...-7d23688 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2024 License: BSD-3-Clause Imports: 3 Imported by: 1

Documentation

Overview

Package disasm implements a 6502 instruction set disassembler.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Disassemble

func Disassemble(c *cpu.CPU, addr uint16, flags Flags, anno string, theme *Theme) (line string, next uint16)

Disassemble the machine code at memory address addr. Return a string representing the disassembled instruction and the address of the next instruction.

func GetCompactRegisterString

func GetCompactRegisterString(r *cpu.Registers) string

GetCompactRegisterString returns a compact string describing the contents of the 6502 registers. It excludes the program counter and stack pointer.

func GetCyclesString

func GetCyclesString(c *cpu.CPU, theme *Theme) string

GetCyclesString returns a string describing the number of elapsed CPU cycles.

func GetRegisterString

func GetRegisterString(r *cpu.Registers) string

GetRegisterString returns a string describing the contents of the 6502 registers. func GetRegisterString(r *cpu.Registers, theme *Theme) string {

Types

type Flags

type Flags uint8
const (
	ShowAddress Flags = 1 << iota
	ShowCode
	ShowInstruction
	ShowRegisters
	ShowCycles
	ShowAnnotations

	ShowBasic = ShowAddress | ShowCode | ShowInstruction | ShowAnnotations
	ShowFull  = ShowAddress | ShowCode | ShowInstruction | ShowRegisters | ShowCycles
)

type Theme

type Theme struct {
	Addr       string
	Code       string
	Inst       string
	Operand    string
	RegName    string
	RegValue   string
	RegEqual   string
	Annotation string
	Reset      string
}

Theme is a struct of color escape codes used to colorize the output of the disassembler.

Jump to

Keyboard shortcuts

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