Quoting ReposeAbout the correction, I think you're adding things up wrong. I only use correction for those columns where it's faster, and I found the break even at 7 adds, so it should work. All but the outer 1 or 2 columns can use it. Ah, good point. Only remaining issue is what to do with the borrow if the correction underflows. My brain hurts..
About the correction, I think you're adding things up wrong. I only use correction for those columns where it's faster, and I found the break even at 7 adds, so it should work. All but the outer 1 or 2 columns can use it.
for tb in range(8): bspecs=getbspecs(tb) doCounts=(tb<7) iv=initialValue[tb] doClears=len(bspecs)<4 and iv!=0 op="lda" if tb==1: emit(" ldx#0") elif tb>1: emit(" txa") op="adc" if doCounts: emit(" ldx#0") if iv!=0: if doClears: bspecs=[pointerReturner( "#${iv:02x}".format(iv=iv), co=(iv>0xef))]+bspecs else: bspecs=bspecs+[pointerReturner( "id+${nv:02x},x".format(nv=0xff-iv), negate=True)] for n,s in enumerate(bspecs): addB(s, op, moveCarry=(n!=len(bspecs)-1), doCounts=doCounts, doClears=doClears) op="adc" emit(" sta mRes+{tb}\n\n".format(tb=tb))
clc ldy mT2+0 lda (zp_fl0),y adc (zp_gl0),y sta mRes+0 ldx#0 lda (zp_fh0),y adc (zp_gh0),y bcc *+3 inx adc (zp_fl1),y bcc *+3 inx adc (zp_gl1),y bcc *+3 inx ldy mT2+1 adc (zp_fl0),y bcc *+3 inx adc (zp_gl0),y bcc *+3 inx sbc id+$3f,x sta mRes+1
54 56 03 03 ----- 01 xx 00 ff 00 ff