There is a small bug affecting the Z80 and GB backend in how we handle generating branches on bit-tests that restricts it to only registers. However bit instructions exist for indirected-hl as well as the same operand for typical ix/iy-indexed operands.
There is a small bug affecting the Z80 and GB backend in how we handle generating branches on bit-tests that restricts it to only registers. However
bit
instructions exist for indirected-hl
as well as the same operand for typicalix
/iy
-indexed operands.Here's a reference showing the relevant bit instructions: http://z80-heaven.wikidot.com/instructions-set:bit
Here is the code in question on Z80, linking the latest commit at the time of this writing: https://github.com/wiz-lang/wiz/blob/3dbe8c5f6cec735eddc9e5adbd185629fea49801/src/wiz/platform/z80_platform.cpp#L1100-L1117
Similar code issue in the gb_platform.cpp file, although it is only missing indirected
hl
to consider.In both platforms, the
bit
instrinsics exist but the test-and-branch generation doesn't look for them if the operand isn't a register.