Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
hcoderLee opened this issue Oct 30, 2021 · 1 comment
Open

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

hcoderLee opened this issue Oct 30, 2021 · 1 comment

Comments

@hcoderLee
Copy link

hcoderLee commented Oct 30, 2021

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.

@hcoderLee hcoderLee changed the title SUB A, r8/d8指令设置标志位C SUB A, r8/d8 command to set flag C Oct 30, 2021
@mohanson
Copy link
Owner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants