Is this a zexdoc bug?

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

Is this a zexdoc bug?

Post by beginner »

Hi everybody,

I was playing around with zexdoc/zexall the other days and I noticed that the <inc,dec> iyh and the <inc,dec> iyl tests are in fact executing the INC/DEC IXH and INC/DEC IXL opcodes instead of INC/DEC IYH and INC/DEC IYL, although with different test data than the <inc,dec> ixh and the <inc,dec> ixl tests, if I am not mistaken. At a first glance it would seem that the INC/DEC IYH and INC/DEC IYL instructions are not tested at all even though the test name would suggest they are.
This seems to be the same for all versions downloaded from https://mdfs.net/Software/Z80/Exerciser/, including the original from YAZE.

Now, I am pretty new to the Z80 ASM and I can't say from looking at the source code, if this is the correct behavior or not.
Is this a bug in zexdoc/zexall? Or some ASM "magic" is going on there? :)

It would be awesome if somebody more knowledgeable could shed some light on this :).

Below is the source code for the mentioned tests from zexdoc. You can notice that instead of FD they are DD prefixed.

Cheers!

Code: Select all

; <inc,dec> iyh (3072 cycles)
incyh:	db	0d7h		; flag mask
	tstr	0ddh,024h,0,0,02836h,09f6fh,09116h,061b9h,082cbh,0e219h,092h,073h,0a98ch
	tstr	0,1,0,0,0ff00h,0,0,0,0,0,0,0,0		; (512 cycles)
	tstr	0,0,0,0,0,0,0,0,0,0,0d7h,0,0		; (6 cycles)
	db	02dh,096h,06ch,0f3h			; expected crc
	tmsg	'<inc,dec> iyh.................'

; <inc,dec> iyl (3072 cycles)
incyl:	db	0d7h		; flag mask
	tstr	0ddh,02ch,0,0,0d7c6h,062d5h,0a09eh,07039h,03e7eh,09f12h,090h,0d9h,0220fh
	tstr	0,1,0,0,0ffh,0,0,0,0,0,0,0,0		; (512 cycles)
	tstr	0,0,0,0,0,0,0,0,0,0,0d7h,0,0		; (6 cycles)
	db	0fbh,0cbh,0bah,095h			; expected crc
	tmsg	'<inc,dec> iyl.................' 
beginner
Drutt
Posts: 37
Joined: Sat May 21, 2022 10:23 pm

Re: Is this a zexdoc bug?

Post by beginner »

Any thoughts? Any help with this would be greatly appreciated :)

Thank you!
Dr beep
Manic Miner
Posts: 387
Joined: Mon Oct 01, 2018 8:53 pm

Re: Is this a zexdoc bug?

Post by Dr beep »

Reading the descriptions I would say the pointers could do the job.

This is testing software, probably for emulator use.

To be honest, if I would start Z80 coding this is not where I would start.
This is a better source to start coding.
www.z80.info
beginner
Drutt
Posts: 37
Joined: Sat May 21, 2022 10:23 pm

Re: Is this a zexdoc bug?

Post by beginner »

Thank you for the reply @Dr beep !
Reading the descriptions I would say the pointers could do the job.
I still find it strange though that the INC/DEC IYH and INC/DEC IYL instructions are not called at all during testing.
To be honest, if I would start Z80 coding this is not where I would start.
This is a better source to start coding.
www.z80.info
Yes, I agree. However I am not on the path of learning Z80 coding at the moment. I was just trying to conceptually understand what is going on there :)

Cheers!
Post Reply