Skip to content

SUB A, r8/d8 command to set flag C #34

@hcoderLee

Description

@hcoderLee

According to the GBCPUman C - Set if no borrow.
In my opinion, the code should be:

self.reg.set_flag(Flag::C, a >= n);

when the value of register A is greater then the number n, a-n is not borrowed. But in the project, the code is:

self.reg.set_flag(C, u16::from(a) < u16::from(n));

Which I couldn't understand.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions