Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
55 lines (45 sloc) 703 Bytes
.model small
.data
res db 11 dup (48)
ans db 11 dup (48)
.code
extrn inum:byte
extrn inum2:byte
public res,add1
extrn display3:far
add1 proc far
xor ax,ax
mov si,9
mov di, 0
mov cx,11
l1:mov al,byte ptr[inum+si]
mov bl,byte ptr[inum2+si]
add al, bl
sub al, 60H
mov dl, 10
div dl
add ah, 30H
add byte ptr[ans+di], ah
inc di
cmp al, 01
jne next
inc byte ptr[ans+di]
next: xor ax, ax
dec si
cmp si, 0
jge l1
cmp al, 01
jne cont
add byte ptr[ans+di], 61H
cont: mov cx, 10
mov si, 0
mov di, 10
rev: mov al, byte ptr[ans+si]
mov byte ptr[res+si], al
inc si
dec di
loop rev
cd1:call display3
ret
add1 endp
end