Comments (1)
Hey,
Thanks for using the tests! Remember if you find a mistake, it may be my fault; do look up the docs. I made these because my original Z80 core was trash, and I had really benefited from similar tests by someone else.
There's definitely some documentation for how X,Y and WZ work that isn't easy to find. The Undocumented Z80 Documented is a good start.
The source for the tests is available in this repository under misc/code_generation/z80_test_generator.js, and my Z80 core is available in the component/cpu/z80 sub-directory.
As to what FD 18 is testing...I guess this may or may not be a bug. Regular opcode 0x18 is defined as "JR_c_e", which is an unconditional relative jump. If you read Z80 Undocumented, you'll see (in reference to DD and FD):
In general, after a DD prefix the instruction is executed as if the DD
weren't there. There are some exceptions:
* Any access to HL is treated as an access to IX (except EX DE,HL and EXX
and the ED prefixed instructions that use HL).
* Any access to (HL) is changed to (IX+d), where d is a signed displacement
byte placed after the main opcode (except JP (HL), which isn't indirect
anyways.
* Any access to H is treated as an access to IXh (the high byte of IX)
Except if (IX+d) is accessed.
* Any access to L is treated as an access to IXl (the low byte of IX)
Except if (IX+d) is accessed.
* A DD prefix before a CB selects a completely different instruction
set (see 1.5).
Anyway, none of those is fulfilled, so it's just treated as a regular 0x18. I know it doesn't show up in opcode tables like that, but it's the behavior the Z80 exhibits. The tests are generated by running through 0xFD00 to 0xFDFF and generating any possibly legal opcodes by running them on a Z80 core ported from Ares (and patched up in the meantime; I've submitted several upstream Z80 issues).
I also asked on the ZX Spectrum Emulator Discord, where there's a lot of people more knowledgeable about the Z80 than I am there, and this behavior was confirmed.
Thanks a bunch again!
Thanks again for using the tests! I'll post back here when I get a response
from jsmoo.
Related Issues (20)
- Need a bit more of a generic assembler, to stop copy-pasting so much code
- Z80 has no unit tests HOT 1
- SNES mode7 broken
- SNES PPU vertical dimension of mosaic does not work
- NES only MMC3 implemented
- Z80 t-state pin accuracy is...low
- ZX Spectrum no way to load a tape, etc. HOT 1
- SPC700 tests never start with H-flag set HOT 5
- sm83: Possible errors in tests HOT 3
- topic addition for better community reach HOT 1
- Tests for opcode 0xdb (Z80) are not reproducible HOT 1
- Flags not correct for opcode 0xED 0xB3 HOT 5
- Query - How to know when test ends? HOT 1
- Z80 - Wrong values of A for opcode tests ED 5F HOT 3
- Z80 opcodes with 11 cycles instead of 12 HOT 2
- Are the flags potentially incorrect for FD 18?
- HALT instruction (0x76) increments PC HOT 4
- Z80 100/101 tests don't reflect what your generated opcodes does HOT 1
- Z80 needs test cases for `ed bx` opcodes when instruction would not jump
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jsmoo.