cpu

package
v0.0.0-...-9f196c3 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2021 License: Unlicense Imports: 4 Imported by: 0

Documentation

Overview

Package cpu implements structs and functions for representing and operating the virtual CPU.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CPU

type CPU struct {
	// Mem is the main memory device used by the CPU.
	Mem *mem.RAM
	// VGA is the main video device used by the CPU.
	VGA *vga.VGA
	// Regs maps numbers to regsiter values.
	Regs map[uint16]uint16
}

CPU is a basic implementation of a CPU.

func NewCPU

func NewCPU(m *mem.RAM, v *vga.VGA) *CPU

NewCPU returns a pointer to a newly initialized CPU.

func (*CPU) Op

func (c *CPU) Op(packedOpcode uint16, unpackedOperands []uint16)

Op executes an opcode with the given operands.

func (*CPU) Run

func (c *CPU) Run(address uint16)

Run starts execution at the given memory address.

Jump to

Keyboard shortcuts

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