Escolar Documentos
Profissional Documentos
Cultura Documentos
data ends
mystack segment
mystack ends
code segment
start:
lea bx,num
mov dh,0ah cmp num,dh jae go mov dl,[bx] and dl,0fh jmp ahed
go: push cx
push ax mov dl,[bx] mov cl,[bx+1] sub dl,30h sub cl,30h mov ch,0ah mov ah,00h mov al,dl mul ch add al,cl mov dl,al pop ax
pop cx
ahed:
jz outer_loop
outer_loop:
dec dl
mov cl,dl
shr cl,01h
inner_loop:
jmp inner_loop
inner_loop_end:
mov dh,0ah cmp dl,dh jae go1 mov ah,dl add ah,30h mov [bx],ah inc bx jmp ahed1
mov ah,00h mov al,dl mov ch,0ah div ch add al,30h mov [bx],al
inc bx
pop cx pop ax
done:
code ends
end start