Skip to content

BIT opcode not lifted correctly #4

@samrussell

Description

@samrussell

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

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions