mirror of
https://github.com/TomHarte/CLK.git
synced 2024-11-22 12:33:29 +00:00
Fix ABCD when the result has an invalid lower digit.
This commit is contained in:
parent
17add4b585
commit
a9902fc817
@ -43,7 +43,7 @@ template <
|
||||
int result = (destination & 0xf) + (source & 0xf) + (status.extend_flag_ ? 1 : 0);
|
||||
if(result > 0x09) result += 0x06;
|
||||
result += (destination & 0xf0) + (source & 0xf0);
|
||||
if(result > 0x99) result += 0x60;
|
||||
if(result > 0x9f) result += 0x60;
|
||||
|
||||
// Set all flags essentially as if this were normal addition.
|
||||
status.zero_result_ |= result & 0xff;
|
||||
|
Loading…
Reference in New Issue
Block a user