Based on some of jimg's ideas, I now have a working ascii adder procedure, and it so far seems very accurate.
ascii_adder proc src1:dword, src2:dword, dst:dword, lent:dword
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
Jim posted a routine in felipes' fibonacci thread, and it reminded me of this project.
So, I stripped out the essential parts and put them into their own procedure. Works well
for generating a fibonacci sequence.