Discover Packages
github.com/no1msd/z80
package
module
Version:
v0.0.0-...-34d2ab4
Opens a new window with list of versions in this module.
Published: Oct 1, 2023
License: MIT
Opens a new window with license information.
Imports: 6
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
README
¶
koron-go/z80
Z80 emulation in Go.
Progress
Z80 instruction set exerciser (documented), passed all 67/67 (100%) tests.
You can try it with...
$ make zexdoc
adc16 - <adc,sbc> hl,<bc,de,hl,sp> (38,912 cycles)
add16 - add hl,<bc,de,hl,sp> (19,456 cycles)
add16x - add ix,<bc,de,ix,sp> (19,456 cycles)
add16y - add iy,<bc,de,iy,sp> (19,456 cycles)
alu8i - aluop a,nn (28,672 cycles)
alu8r - aluop a,<b,c,d,e,h,l,(hl),a> (753,664 cycles)
alu8rx - aluop a,<ixh,ixl,iyh,iyl> (376,832 cycles)
alu8x - aluop a,(<ix,iy>+1) (229,376 cycles)
bitx - bit n,(<ix,iy>+1) (2048 cycles)
bitz80 - bit n,<b,c,d,e,h,l,(hl),a> (49,152 cycles)
cpd1 - cpd<r> (1) (6144 cycles)
cpi1 - cpi<r> (1) (6144 cycles)
daaop - <daa,cpl,scf,ccf> (65,536 cycles)
inca - <inc,dec> a (3072 cycles)
incb - <inc,dec> b (3072 cycles)
incbc - <inc,dec> bc (1536 cycles)
incc - <inc,dec> c (3072 cycles)
incd - <inc,dec> d (3072 cycles)
incde - <inc,dec> de (1536 cycles)
ince - <inc,dec> e (3072 cycles)
inch - <inc,dec> h (3072 cycles)
inchl - <inc,dec> hl (1536 cycles)
incix - <inc,dec> ix (1536 cycles)
inciy - <inc,dec> iy (1536 cycles)
incl - <inc,dec> l (3072 cycles)
incm - <inc,dec> (hl) (3072 cycles)
incsp - <inc,dec> sp (1536 cycles)
incx - <inc,dec> (<ix,iy>+1) (6144 cycles)
incxh - <inc,dec> ixh (3072 cycles)
incxl - <inc,dec> ixl (3072 cycles)
incyh - <inc,dec> iyh (3072 cycles)
incyl - <inc,dec> iyl (3072 cycles)
ld161 - ld <bc,de>,(nnnn) (32 cycles)
ld162 - ld hl,(nnnn) (16 cycles)
ld163 - ld sp,(nnnn) (16 cycles)
ld164 - ld <ix,iy>,(nnnn) (32 cycles)
ld165 - ld (nnnn),<bc,de> (64 cycles)
ld166 - ld (nnnn),hl (16 cycles)
ld167 - ld (nnnn),sp (16 cycles)
ld168 - ld (nnnn),<ix,iy> (64 cycles)
ld16im - ld <bc,de,hl,sp>,nnnn (64 cycles)
ld16ix - ld <ix,iy>,nnnn (32 cycles)
ld8bd - ld a,<(bc),(de)> (44 cycles)
ld8im - ld <b,c,d,e,h,l,(hl),a>,nn (64 cycles)
ld8imx - ld (<ix,iy>+1),nn (32 cycles)
ld8ix1 - ld <b,c,d,e>,(<ix,iy>+1) (512 cycles)
ld8ix2 - ld <h,l>,(<ix,iy>+1) (256 cycles)
ld8ix3 - ld a,(<ix,iy>+1) (128 cycles)
ld8ixy - ld <ixh,ixl,iyh,iyl>,nn (32 cycles)
ld8rr - ld <b,c,d,e,h,l,a>,<b,c,d,e,h,l,a> (3456 cycles)
ld8rrx - ld <b,c,d,e,ixy,a>,<b,c,d,e,ixy,a> (6912 cycles)
lda - ld a,(nnnn) / ld (nnnn),a (44 cycles)
ldd1 - ldd<r> (1) (44 cycles)
ldd2 - ldd<r> (2) (44 cycles)
ldi1 - ldi<r> (1) (44 cycles)
ldi2 - ldi<r> (2) (44 cycles)
negop - neg (16,384 cycles)
rldop - <rld,rrd> (7168 cycles)
rot8080 - <rlca,rrca,rla,rra> (6144 cycles)
rotxy - shift/rotate (<ix,iy>+1) (416 cycles)
rotz80 - shift/rotate <b,c,d,e,h,l,(hl),a> (6784 cycles)
srz80 - <set,res> n,<b,c,d,e,h,l,(hl),a> (7936 cycles)
srzx - <set,res> n,(<ix,iy>+1) (1792 cycles)
st8ix1 - ld (<ix,iy>+1),<b,c,d,e> (1024 cycles)
st8ix2 - ld (<ix,iy>+1),<h,l> (256 cycles)
st8ix3 - ld (<ix,iy>+1),a (64 cycles)
stabd - ld (<bc,de>),a (96 cycles)
References
Expand ▾
Collapse ▴
Documentation
¶
Package z80 emulates Zilog's Z80 CPU.
ErrBreakPoint shows PC is reached to one of break points.
CPU is Z80 emulator.
Build builds a Z80 CPU emulator with given options.
Run executes instructions till HALT or error.
Step executes an instruction.
DumbIO provides IO interface as wrapper of []uint8
In gets a byte at addr of IO
Out sets a byte at addr of IO
DumbMemory provides Memory interface as wrapper of []uint8
Get gets a byte at addr of memory.
Put puts "data" block from addr.
Set sets a byte at addr of memory.
GPR is general purpose reigsters, pair of four registers AF, BC, DE and HL.
type INT interface {
CheckINT() []uint8
ReturnINT()
}
INT is interface for maskable interrupt.
IO is requirements interface for I/O.
type InterruptMonitor interface {
OnInterrupt(maskable bool , oldPC, newPC uint16 )
}
InterruptMonitor monitors interruptions.
MapMemory implements Memory interface with a map.
Clone creates a clone of this.
Equal checks two MapMemory same or not.
Get gets a byte at addr of memory.
Put puts "data" block from addr.
Set sets a byte at addr of memory.
Memory is requirements interface for memory.
type NMI interface {
CheckNMI() bool
}
NMI is interruption for non-maskable interrupt.
type Option interface {
}
Option is an optional element for Build.
WithINT is an option to setup with INT.
WithIO is an option to setup with IO.
WithInterruptMonitor is an option to setup with InterruptMonitor.
WithMemory is an option to setup with Memory.
WithNMI is an option to setup with NMI.
Register is 16 bits register.
SetU16 updates 16 bits value of this register.
U16 gets 16 bits value of this register.
SPR is special purpose registers.
States is collection of Z80's internal state.
Source Files
¶
Directories
¶
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.
Click to show internal directories.
Click to hide internal directories.