I need to add a signed 8 bit number (in zero page location TEMP1) to a stored 16 bit number (in zero page locations LVALL,H). Below is my current method. I was wondering if anyone had any suggestions or improvements.
Code: Select all
ADD16X
LDX #$00
LDA TEMP1 ; signed 8 bit number
CMP #$00
BPL .CONT
DEX ; bit 7 was set, so it's a negative
.CONT STX TEMP2
CLC
ADC LVALL
STA LVALL ; update the stored number low byte
LDA LVALH
ADC TEMP2
STA LVALH ; update the stored number high byte
RTS
Ken