Updated CRCs for ST variant CCF/SCF tests with undocumented flags #7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 toA & 0b0010_1000 | F & 0b0000_1000
to pass. With this change, bit flags must be set toA & 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 fromA | F
or justF
, so that shouldn't need to be updated. I also didn't get an error fromz80ccf
.