mirror of
https://github.com/TomHarte/CLK.git
synced 2024-11-26 08:49:37 +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);
|
int result = (destination & 0xf) + (source & 0xf) + (status.extend_flag_ ? 1 : 0);
|
||||||
if(result > 0x09) result += 0x06;
|
if(result > 0x09) result += 0x06;
|
||||||
result += (destination & 0xf0) + (source & 0xf0);
|
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.
|
// Set all flags essentially as if this were normal addition.
|
||||||
status.zero_result_ |= result & 0xff;
|
status.zero_result_ |= result & 0xff;
|
||||||
|
Loading…
Reference in New Issue
Block a user