An open API service indexing awesome lists of open source software.

https://github.com/koron-go/z80

Z80 emulator written in Go
https://github.com/koron-go/z80

z80 z80-emulator

Last synced: 5 months ago
JSON representation

Z80 emulator written in Go

Awesome Lists containing this project

README

          

# koron-go/z80

[![PkgGoDev](https://pkg.go.dev/badge/github.com/koron-go/z80)](https://pkg.go.dev/github.com/koron-go/z80)
[![Actions/Go](https://github.com/koron-go/z80/workflows/Go/badge.svg)](https://github.com/koron-go/z80/actions?query=workflow%3AGo)
[![Go Report Card](https://goreportcard.com/badge/github.com/koron-go/z80)](https://goreportcard.com/report/github.com/koron-go/z80)

Z80 emulation in Go.

koron-go/z80 is [highly compatible](#compatibility) with the actual Z80, and is extremely fast.

## Getting started

Install or update:

```console
$ go get github.com/koron-go/z80@latest
```

(WRITE MINIMAL SAMPLE CODES HERE)

## Compatibility

Z80 instruction set exerciser (documented), passed all 67/67 (100%) tests.

You can try it with...
```console
$ make zexdoc
```

Z80 instruction set exerciser (all), passed all 67/67 (100%) tests.

You can try it with...
```console
$ make zexall
```

* [x] adc16 - ` hl, (38,912 cycles)`
* [x] add16 - `add hl, (19,456 cycles)`
* [x] add16x - `add ix, (19,456 cycles)`
* [x] add16y - `add iy, (19,456 cycles)`
* [x] alu8i - `aluop a,nn (28,672 cycles)`
* [x] alu8r - `aluop a, (753,664 cycles)`
* [x] alu8rx - `aluop a, (376,832 cycles)`
* [x] alu8x - `aluop a,(+1) (229,376 cycles)`
* [x] bitx - `bit n,(+1) (2048 cycles)`
* [x] bitz80 - `bit n, (49,152 cycles)`
* [x] cpd1 - `cpd (1) (6144 cycles)`
* [x] cpi1 - `cpi (1) (6144 cycles)`
* [x] daaop - ` (65,536 cycles)`
* [x] inca - ` a (3072 cycles)`
* [x] incb - ` b (3072 cycles)`
* [x] incbc - ` bc (1536 cycles)`
* [x] incc - ` c (3072 cycles)`
* [x] incd - ` d (3072 cycles)`
* [x] incde - ` de (1536 cycles)`
* [x] ince - ` e (3072 cycles)`
* [x] inch - ` h (3072 cycles)`
* [x] inchl - ` hl (1536 cycles)`
* [x] incix - ` ix (1536 cycles)`
* [x] inciy - ` iy (1536 cycles)`
* [x] incl - ` l (3072 cycles)`
* [x] incm - ` (hl) (3072 cycles)`
* [x] incsp - ` sp (1536 cycles)`
* [x] incx - ` (+1) (6144 cycles)`
* [x] incxh - ` ixh (3072 cycles)`
* [x] incxl - ` ixl (3072 cycles)`
* [x] incyh - ` iyh (3072 cycles)`
* [x] incyl - ` iyl (3072 cycles)`
* [x] ld161 - `ld ,(nnnn) (32 cycles)`
* [x] ld162 - `ld hl,(nnnn) (16 cycles)`
* [x] ld163 - `ld sp,(nnnn) (16 cycles)`
* [x] ld164 - `ld ,(nnnn) (32 cycles)`
* [x] ld165 - `ld (nnnn), (64 cycles)`
* [x] ld166 - `ld (nnnn),hl (16 cycles)`
* [x] ld167 - `ld (nnnn),sp (16 cycles)`
* [x] ld168 - `ld (nnnn), (64 cycles)`
* [x] ld16im - `ld ,nnnn (64 cycles)`
* [x] ld16ix - `ld ,nnnn (32 cycles)`
* [x] ld8bd - `ld a,<(bc),(de)> (44 cycles)`
* [x] ld8im - `ld ,nn (64 cycles)`
* [x] ld8imx - `ld (+1),nn (32 cycles)`
* [x] ld8ix1 - `ld ,(+1) (512 cycles)`
* [x] ld8ix2 - `ld ,(+1) (256 cycles)`
* [x] ld8ix3 - `ld a,(+1) (128 cycles)`
* [x] ld8ixy - `ld ,nn (32 cycles)`
* [x] ld8rr - `ld , (3456 cycles)`
* [x] ld8rrx - `ld , (6912 cycles)`
* [x] lda - `ld a,(nnnn) / ld (nnnn),a (44 cycles)`
* [x] ldd1 - `ldd (1) (44 cycles)`
* [x] ldd2 - `ldd (2) (44 cycles)`
* [x] ldi1 - `ldi (1) (44 cycles)`
* [x] ldi2 - `ldi (2) (44 cycles)`
* [x] negop - `neg (16,384 cycles)`
* [x] rldop - ` (7168 cycles)`
* [x] rot8080 - ` (6144 cycles)`
* [x] rotxy - `shift/rotate (+1) (416 cycles)`
* [x] rotz80 - `shift/rotate (6784 cycles)`
* [x] srz80 - ` n, (7936 cycles)`
* [x] srzx - ` n,(+1) (1792 cycles)`
* [x] st8ix1 - `ld (+1), (1024 cycles)`
* [x] st8ix2 - `ld (+1), (256 cycles)`
* [x] st8ix3 - `ld (+1),a (64 cycles)`
* [x] stabd - `ld (),a (96 cycles)`

## References

* [zmac - Z-80 Macro Cross Assembler](http://48k.ca/zmac.html)

* [Z80 Instruction Exerciser](http://mdfs.net/Software/Z80/Exerciser/)

* [zmac port](https://github.com/obiwanjacobi/Zim80/tree/master/Source/Code/Jacobi.Zim80.IntegrationTests/CpuZ80/Zexlax)
* [another zmac port](https://github.com/DavidDiPaola/esp32_crimbus-lights-z80/blob/master/src/z80/roms/zexdoc.src)

* [HOME OF THE Z80 CPU](http://www.z80.info/)

* [Z80 instruction set (tables)](http://clrhome.org/table/)

* [WebMSX](https://webmsx.org/)

* [Z80 implementation](https://github.com/ppeccin/WebMSX/blob/master/src/main/msx/cpu/CPU.js)
* [Media Loading](https://github.com/ppeccin/WebMSX/blob/master/README.md#media-loading)

* [fMSX](https://fms.komkon.org/fMSX/)

* [Yet Another Z80 Emulator by AG](http://www.mathematik.uni-ulm.de/users/ag/yaze-ag/)

* [Visual Z80 Remix](https://floooh.github.io/visualz80remix/)

### Japanese documents

* [Zilog Z80 DAA実行結果](http://ver0.sakura.ne.jp/doc/daa.html)

LZ8514(SHARPのZ80互換CPU)で実際に実行して得た結果

* [Z80 DAA 内部キャリーフラグは実在するのか?](https://uniabis.net/pico/msx/z80daa/)

* [8ビット CPU Z80命令セット](http://www.yamamo10.jp/yamamoto/comp/Z80/instructions/index.php)

* [MSXテープイメージ解説書](http://park16.wakwak.com/~msx/imagesei/tape.html)

* [MSX Datapack wiki](http://ngs.no.coocan.jp/doc/wiki.cgi/datapack?page=FrontPage)

* [テクハンwiki](http://ngs.no.coocan.jp/doc/wiki.cgi/TechHan)

* [MSX JAPAN/ファイル形式](https://msxjpn.jimdofree.com/%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E5%BD%A2%E5%BC%8F/)

* [8ビット CPU Z80タイミング](http://www.yamamo10.jp/yamamoto/comp/Z80/Z80_Timming/index.php)

* [Z80のRレジスタについて](https://electrelic.com/electrelic/node/1506)