Skip to content

AND does not clear the carry flag #16

Description

@xusheng6

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions