You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In v0.9.0 documentation, there are a couple of problems in the DAA explanation.
The first problem is the carry flag output. For both addition and subtraction, the carry output should always be based on the condition in step 3 (set if $60 is added to the adjustment, reset otherwise). Incidentally, for subtraction, this means it always preserves the carry flag, which might be worth mentioning.
The second problem is in the condition in step 3 for addition. "If the carry flag is set or A > $9F" should be "If the carry flag is set or A > $99". Comparing to $9F would only be valid if the adjustment value from step 2 was already added to A and the carry-out from that was also OR'd into the carry flag. Comparing to $99, on the other hand, handles this case cleanly because values between $9A and $9F always have an adjustment of $6 in step 2, and if it were added to A it would then be greater than $9F.
The text was updated successfully, but these errors were encountered:
Rangi42
added
docs
This affects the documentation (web-specific issues go to rgbds-www)
rgbasm
This affects RGBASM
labels
Jan 6, 2025
In v0.9.0 documentation, there are a couple of problems in the DAA explanation.
The first problem is the carry flag output. For both addition and subtraction, the carry output should always be based on the condition in step 3 (set if $60 is added to the adjustment, reset otherwise). Incidentally, for subtraction, this means it always preserves the carry flag, which might be worth mentioning.
The second problem is in the condition in step 3 for addition. "If the carry flag is set or A > $9F" should be "If the carry flag is set or A > $99". Comparing to $9F would only be valid if the adjustment value from step 2 was already added to A and the carry-out from that was also OR'd into the carry flag. Comparing to $99, on the other hand, handles this case cleanly because values between $9A and $9F always have an adjustment of $6 in step 2, and if it were added to A it would then be greater than $9F.
The text was updated successfully, but these errors were encountered: