Vector35 / Vector35/Z80

(lifting) fix AF modifications updating flags

Open
#9 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
12
Forks
5
PR merge metrics
No merged PRs in 30d

Description

Current lifting is broken, implementation is here:

    elif decoded.op == OP.POP:
        # possible operands are: af bc de hl ix iy
        flag_write_type = '*' if oper_val == REG.AF else None

        size = REG_TO_SIZE[oper_val]
        tmp = il.pop(size)
        tmp = il.set_reg(size, reg2str(oper_val), tmp, flag_write_type)
        il.append(tmp)

But the flag lifter watches for LLIL_POP (which doesn't trigger flags) instead of LLIL_LOAD ( which does trigger flags)

We'll also need to look closer at the ld lifter to make sure any time we're loading into AF (including the ex opcode) we tell it to do all flags, otherwise none

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in the lifting implementation shown in the issue and trace how POP, LOAD, ld, and ex operations update AF. Verify that AF loads, including ex, mark all flags and that the flag lifter responds to the correct IL operation. Confirm the change with the project's existing tests, though no specific test file is named.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.