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))