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 [2021-01-20 10:15] – [Forming terms] bitbreaker | base:advanced_optimizing [2021-03-05 16:57] – [Forming terms] bitbreaker | ||
---|---|---|---|
Line 1430: | Line 1430: | ||
sbc num | sbc num | ||
sta neg | sta neg | ||
+ | | ||
+ | ;num in a, carry set | ||
+ | lda num | ||
+ | sbc #$01 | ||
+ | eor #$ff | ||
</ | </ | ||
- | 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. Also the carry flag after the negation can be influenced, depending on using sbc or adc for most cases ($00/$ff will cause an overflow). |
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: | 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: |
base/advanced_optimizing.txt · Last modified: 2024-03-03 11:06 by bitbreaker