mirror of
https://github.com/TomHarte/CLK.git
synced 2026-04-19 19:16:34 +00:00
Eliminate 16-bit arithmetic from SBX.
This commit is contained in:
@@ -152,10 +152,9 @@ void arr(RegistersT ®isters, const uint8_t operand) {
|
||||
template <typename RegistersT>
|
||||
void sbx(RegistersT ®isters, const uint8_t operand) {
|
||||
registers.x &= registers.a;
|
||||
const uint16_t difference = registers.x - operand;
|
||||
registers.x = uint8_t(difference);
|
||||
registers.flags.carry = operand <= registers.x;
|
||||
registers.x -= operand;
|
||||
registers.flags.set_nz(registers.x);
|
||||
registers.flags.carry = ((difference >> 8)&1)^1;
|
||||
}
|
||||
|
||||
template <typename RegistersT>
|
||||
|
||||
Reference in New Issue
Block a user