BIT opcode not lifted correctly
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 42/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- python
- Domain
- reverse-engineering
Research direction
Start by locating the Python handler for decoded.op == OP.BIT and the il.and_expr call shown in the issue. Compare the lifted flags with Z80 BIT semantics, then verify that the resulting IL sets Z from the tested bit while setting H and clearing N.
Written by the indexing model from the issue text.
Description
need to set H, unset N, and set Z based on the bit, can probably just change the op that is appended:
elif decoded.op == OP.BIT:
assert oper_type == OPER_TYPE.IMM
assert oper_val >= 0 and oper_val <= 7
mask = il.const(1, 1<<oper_val)
operand = operand_to_il(operb_type, operb_val, il, 1)
- il.append(il.and_expr(1, operand, mask, flags='*'))
+ il.append(il.and_expr(1, operand, mask, flags='z'))
and then manually set the other 2 flags
- 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
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/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
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