Hi Roland,
Here is your multiplier with most of the stringware replaced with byte overlays. I have verified it against examples/math/mulhuge.o2bas.
It does your large calculation in 1.4 seconds on my notebook, but I have not looked at the rest of the code.
function str_mult(string a,b) as string
string r ' result
int ax = 0, bx = 0, rx = 0, al, bl
int carry, n
int an, bn, rn, t 'auxiliary
al = len(a) : bl = len(b)
r = stringbytes (al+bl,48) 'FILL 0000..
byte aa at strptr a
byte bb at strptr b
byte rr at strptr r
indexbase 1
macro midval(b,i){ b[i]-48 } 'ASCII TO DIGIT VALUE
' grade-school method of multiplication
for ax = al to 1 step -1
carry = 0
for bx = bl to 1 step -1
rx = ax + bx
an=midval(aa,ax)
bn=midval(bb,bx)
rn=midval(rr,rx)
n=an * bn + rn + carry
rr[rx]=mod(n,10)+48
carry = n \ 10
next bx
rx--
'int t=midval(r,rx) + carry
rr[rx]+=carry 'FINAL CARRY
next ax
' omit possible first place - zero
if rr[1]=48 then return mid(r,2)
return r
end function
/*
a="4225678345671239269412376809064563457830987094214727890460503258124429509352125309123467889090967803"
b="9034098905607687535809534264324877930963452357175890408065643678402109067842097453251206046098340056"
ans1="38175196118078646234796018047078508876075927016257021775208337789644882612626336290568135391711676360295755214293161291134825045621348587392814424177752560047244220841334894056033458232344500841216968"
ans2=str_mult(a,b)
printl ans1
printl ans2
waitkey
*/