ldx #0 clc lda n1 adc n2 bcc s1 inx adc #0;fix sec;fix s1 adc n3 bcc s2 inx stx h sec sbc h sta l
sec sbc id,x
txa ldx #0
a2 a1 a0 b1 b0 + c1 c0 -------- r2 r1 r0 2 clc 3 lda a0 3 adc b0 2 tax;a0+b0 3 lda a1 3 adc b1 2 tay;a1+b1 3 adc a2 3 sta r2 2 txa ;no clc as there's never a carry from r2, in a mult 3 adc c0 3 sta r0 2 tya 3 adc c1 3 sta r1 3 bcc s1;3/7 avg 5 5 inc r2 s1 rts