Documentation ¶
Overview ¶
Package z80 emulates Zilog's Z80 CPU.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrBreakPoint = errors.New("break point reached")
ErrBreakPoint shows PC is reached to one of break points.
Functions ¶
This section is empty.
Types ¶
type CPU ¶
type CPU struct { States Memory Memory IO IO // RETNHandle is called when CPU execute a RETN op. RETNHandler RETNHandler // RETIHandle is called when CPU execute a RETI op. RETIHandler RETIHandler // Interrupt is a signal to interrupt. When you set non-nil value, then // CPU.Step and CPU.Run treat it as one of Z80 interruptions. Interrupt *Interrupt BreakPoints map[uint16]struct{} // HALT indicates whether the last Run() is terminated with HALT op. HALT bool }
CPU is the core of Z80 emulator.
type DumbMemory ¶
type DumbMemory []uint8
DumbMemory provides Memory interface as wrapper of []uint8
func (DumbMemory) Get ¶
func (dm DumbMemory) Get(addr uint16) uint8
Get gets a byte at addr of memory.
func (DumbMemory) Put ¶
func (dm DumbMemory) Put(addr uint16, data ...uint8) DumbMemory
Put puts "data" block from addr.
func (DumbMemory) Set ¶
func (dm DumbMemory) Set(addr uint16, value uint8)
Set sets a byte at addr of memory.
type INT ¶
type INT interface { // CheckINT should return valid interruption data if maskable interruption // made. The data is used for interruption codes or as a vector depending // on interruption mode. CheckINT() []uint8 // ReturnINT is called when "RETI" op is executed. ReturnINT() }
INT is interface for maskable interrupt.
type Interrupt ¶ added in v0.10.0
type Interrupt struct { Type InterruptType Data []uint8 }
Interrupt is interruption signal. Put a point of Interrupt to CPU.Interrupt, when you want to make an interrupt.
func IM0Interrupt ¶ added in v0.10.0
IM0Interrupt creates an Interrupt object for IM0.
func IM1Interrupt ¶ added in v0.10.0
func IM1Interrupt() *Interrupt
IM1Interrupt creates an Interrupt object for IM1.
func IM2Interrupt ¶ added in v0.10.0
IM2Interrupt creates an Interrupt object for IM2.
func NMIInterrupt ¶ added in v0.10.0
func NMIInterrupt() *Interrupt
NMIInterrupt creates a Interrupt objct for NMI.
type InterruptType ¶ added in v0.10.0
type InterruptType int
InterruptType is type of interruption.
const ( // NMIType is a type of NMI interruption. NMIType InterruptType = iota // IMType is a type of normal interruptions. IMType )
type MapMemory ¶
MapMemory implements Memory interface with a map.
type NMI ¶
type NMI interface { // CheckNMI should return true if non-maskable interruption made. CheckNMI() bool // ReturnNMI is called when "RETN" op is executed. ReturnNMI() }
NMI is interruption for non-maskable interrupt.
type RETIHandler ¶ added in v0.10.0
type RETIHandler interface {
RETIHandle()
}
RETIHandler will be called before execute RETI opcode.
type RETNHandler ¶ added in v0.10.0
type RETNHandler interface {
RETNHandle()
}
RETNHandler will be called before execute RETN opcode.
type Register ¶
Register is 16 bits register.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
internal
|
|
tinycpm
Package tinycpm provides minimal CP/M compatible BIOS to run Z80 Exerciser tests.
|
Package tinycpm provides minimal CP/M compatible BIOS to run Z80 Exerciser tests. |
zex
Package zex provides test cases of Z80 Exerciser.
|
Package zex provides test cases of Z80 Exerciser. |