Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated CRCs for ST variant CCF/SCF tests with undocumented flags #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rzumer
Copy link

@rzumer rzumer commented Dec 15, 2024

Recent research has shown that the CCF/SCF instructions, on ST CMOS variants, only change the 5th bit of the flag register (aka "Y") if flags were modified by the previous instruction. If flags are stable, then only bit 3 is set according to the A register.

This subtle difference in behavior does not appear to influence the output of the z80ccfscr program, but it does change the register state reflected in the checksums of the standard test suite.

Reference: redcode/Z80_XCF_Flavor#2 (comment)

I don't have an assembler set up, so I tested this by editing the CRCs in the tap files from release 1.2a directly (using a hex editor) and validating the checksums in my emulator. With v1.2a, if flags are stable (i.e. they were untouched in the previous instruction), bit flags must be set to A & 0b0010_1000 | F & 0b0000_1000 to pass. With this change, bit flags must be set to A & 0b0010_0000 | F & 0b0000_1000.

I also have a test case to compare a screen capture of the ccfscr program with the reference images, and it looks like the output matches whether bit 5 is produced from A | F or just F, so that shouldn't need to be updated. I also didn't get an error from z80ccf.

Recent research has shown that the CCF/SCF instructions, on ST CMOS
variants, only change the 5th bit of the flag register (aka "Y") if
flags were modified by the previous instruction. If flags are stable,
then only bit 3 is set according to the A register.

This subtle difference in behavior does not appear to influence the
output of the z80ccfscr program, but it does change the register state
reflected in the checksums of the standard test suite.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant