1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-19 23:32:28 +00:00

Mutate SBCD to correct values, though not yet statuses.

This commit is contained in:
Thomas Harte 2022-05-12 07:22:26 -04:00
parent 0efeea1294
commit bd61c72007

View File

@ -794,7 +794,7 @@ template <
if(result & 0xf0) result -= 0x06; \ if(result & 0xf0) result -= 0x06; \
result += (destination & 0xf0) - (source & 0xf0); \ result += (destination & 0xf0) - (source & 0xf0); \
status.extend_flag_ = status.carry_flag_ = decltype(status.carry_flag_)((result & 0xff) > 0x9f); \ status.extend_flag_ = status.carry_flag_ = decltype(status.carry_flag_)((result & 0xff) > 0x9f); \
if(status.carry_flag_) result -= 0x60; \ if(unadjusted_result & 0x100) result -= 0x60; \
\ \
/* Set all flags essentially as if this were normal subtraction. */ \ /* Set all flags essentially as if this were normal subtraction. */ \
status.zero_result_ |= result & 0xff; \ status.zero_result_ |= result & 0xff; \