Hi, first post here.
I have noticed what could be an error in this section of the wiki: https://www.nesdev.org/wiki/6502_assemb ... th_ADC/SBC.
The part that reads:
Just to clarify, if it is known that the carry is clear, if the original code is:then the optimized code will be:
I have noticed what could be an error in this section of the wiki: https://www.nesdev.org/wiki/6502_assemb ... th_ADC/SBC.
The part that reads:
should be changed to:When it is known that carry is clear, SEC instruction can be avoided by just doing SBC #(value+1)
I have checked different scenarios to support this.When it is known that carry is clear, SEC instruction can be avoided by just doing SBC #(value-1)
Just to clarify, if it is known that the carry is clear, if the original code is:
Code:
lda #$03secsbc #$01
Code:
lda #$03sbc #$00
Statistics: Posted by Ooxie — Mon Mar 18, 2024 1:59 pm — Replies 2 — Views 115