base:advanced_optimizing
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
base:advanced_optimizing [2018-09-13 14:26] – [Counting bits] bitbreaker | base:advanced_optimizing [2021-01-20 10:15] – [Forming terms] bitbreaker | ||
---|---|---|---|
Line 1433: | Line 1433: | ||
There are of course also other expressions possible, just ponder a while about the term. | There are of course also other expressions possible, just ponder a while about the term. | ||
+ | |||
+ | How's about forming terms with logical operations? We notice, that for e.g. (a + b) xor $ff is the same as (a xor $ff) - b: | ||
+ | |||
+ | < | ||
+ | lda num1 | ||
+ | clc | ||
+ | adc num2 | ||
+ | eor #$ff | ||
+ | |||
+ | ;can also be written as | ||
+ | lda num1 | ||
+ | eor #$ff | ||
+ | sec | ||
+ | sbc num2 | ||
+ | </ | ||
====== Running out of registers ====== | ====== Running out of registers ====== | ||
base/advanced_optimizing.txt · Last modified: 2024-03-03 11:06 by bitbreaker