To add a signed 8-bit delta to a 16-bit value, we need to sign-extend the delta to a full 16 bits. We hold the high byte of the delta in .X and set it to $00 or $ff based on its sign:
ldx #$00 ; implied high byte of delta lda delta bpl :+ dex ; high byte becomes $ff to reflect negative delta :clc adc value ; normal 16-bit addition sta value txa adc value+1 sta value+1
White Flame (aka David Holz)