BIT opcode not lifted correctly
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 12
- Forks
- 5
- PR merge metrics
- No merged PRs in 30d
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
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.
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.
Assessment
- Tech stack
- python
- Domain
- reverse-engineering
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100