I might as well post too. :P
Ascii Adder. Directly adds two ascii integers, no matter the length (size) of the integers, well tested in a fibonacci generator - so that the limit is known to be far beyond capability of simple 32 or 64 bit registers. (and most calculators.)
Integer 1 (src1), integer 2 (src2), destination(dst) all have seperate buffers. credit due to jimg for showing a better way to implement what I was originally trying. 8)
ascii_adder proc src1:dword, src2:dword, dst:dword, lent:dword ;(src1, src2, dst are pointers to already allocated memory. lent is the length of the largest value to be summed)
local carrie:dword
push esi
push edi
push ebx
mov esi, src1
mov edi, src2
mov ebx, dst
mov ecx, lent
mov carrie, 0
top:
mov eax,0
mov al,byte ptr [esi+ecx-1]
mov dl,byte ptr [edi+ecx-1]
add al,dl
sub al, 30h
add eax, carrie
mov carrie, 0
cmp al, 39h
jbe @f
mov carrie, 1
sub al, 10
@@:
mov [ebx+ecx-1], al
dec ecx
cmp ecx, 0
jnz top
pop ebx
pop edi
pop esi
ret
ascii_adder endp