z80test with LDxR->NOP' and INxR->NOP'

Struggling with Fuse or trying to find an emulator with a specific feature. Ask your questions here.
Post Reply
beginner
Drutt
Posts: 37
Joined: Sat May 21, 2022 10:23 pm

z80test with LDxR->NOP' and INxR->NOP'

Post by beginner »

Hi everybody,

I recently thought I'll test my Z80 CPU emulator implementation using @Patrik Rak's z80test tester.
Since currently my emulator only handles the documented flags, I used the z80doc variant.

I was thrilled to see that almost all tests passed. However, there were 4 tests that did not.
More precisely the following ones failed:

Code: Select all

089 LDIR->NOP'    FAILED
090 LDDR->NOP'    FAILED

102 INIR->NOP'    FAILED
103 INDR->NOP'    FAILED
Their NOP'-free counterparts (LDIR, LDDR, INIR, INDR) passed successfully.

After digging online about this, I couldn't really find much info about what these tests are actually doing so that I could update my code and handle them properly.

I was wondering if anybody could give me a bit more info about them? What are these test actually testing?

Any help would be appreciated! :)
Patrik Rak
Microbot
Posts: 117
Joined: Mon Apr 13, 2020 3:07 pm

Re: z80test with LDxR->NOP' and INxR->NOP'

Post by Patrik Rak »

These tests are set up in such a way that the instruction overwrites itself, effectively turning the instruction into ED prefixed NOP. This in turn has the effect that it reveals how flags are set in case the instruction repeats itself, rather than how they are set when it finishes.

Similar test was written which tests all block instructions by interrupting them. But because that one depends on perfect emulation of timing, which may be difficult to achieve at first, this one was added to my test suite to complement that.
User avatar
ZjoyKiLer
Dizzy
Posts: 67
Joined: Thu Sep 09, 2021 3:20 pm

Re: z80test with LDxR->NOP' and INxR->NOP'

Post by ZjoyKiLer »

the.beginner wrote: Fri Jun 10, 2022 12:34 pm Hi everybody,

I recently thought I'll test my Z80 CPU emulator implementation using @Patrik Rak's z80test tester.
Since currently my emulator only handles the documented flags, I used the z80doc variant.

I was thrilled to see that almost all tests passed. However, there were 4 tests that did not.
More precisely the following ones failed:

Code: Select all

089 LDIR->NOP'    FAILED
090 LDDR->NOP'    FAILED

102 INIR->NOP'    FAILED
103 INDR->NOP'    FAILED
Their NOP'-free counterparts (LDIR, LDDR, INIR, INDR) passed successfully.

After digging online about this, I couldn't really find much info about what these tests are actually doing so that I could update my code and handle them properly.

I was wondering if anybody could give me a bit more info about them? What are these test actually testing?

Any help would be appreciated! :)
Take a look at this: viewtopic.php?t=6102
beginner
Drutt
Posts: 37
Joined: Sat May 21, 2022 10:23 pm

Re: z80test with LDxR->NOP' and INxR->NOP'

Post by beginner »

Thank you for the details, @Patrik Rak , @ZjoyKiLer :)
Post Reply