AND does not clear the carry flag
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 75/100
Research direction
Start in Z80IL.py at OP.AND and compare its flags handling with OP.OR and OP.XOR. Check how the flags string represents Z80 carry, subtract, and half-carry behavior, then verify the referenced test binary's AND and subsequent SBC cases no longer depend on stale carry.
Written by the indexing model from the issue text.
Description
OP.AND in Z80IL.py uses flags="z", while OP.OR and OP.XOR use flags="*".
The Z80 AND also clears C (and N, and sets H). This matters because AND A / OR A is the idiomatic way to clear carry before SBC HL,rr — with only Z modelled, the carry clear is invisible and the following SBC looks like it depends on a stale flag.
139 sites in one test binary.
- Dominant language
- Python
- Stars
- 12
- Forks
- 5
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Vector35/Z80
-
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
INC writes no flags Open
Difficulty 1/5 Under an hour Newbie friendliness 86/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100