code is here, my computer is x86.The function of this code is the transfer Hexadecimal to Decimal , but haved be finished yet .Now it just put the figer in stack.
ASSUME cs:code,ds:data
data SEGMENT
ENDS
code SEGMENT
start:
mov ax,data
mov ds,ax
mov bx,19 ;the number needed to be output as decimal format is saved in bx
call output
mov ah,4CH
int 21H
output proc
mov ax,bx ;the number that needed to be output is saved in bx , now move it to ax
mov bx,10
mov cx,0 ;use cx to record how many figure needed to be output
division:
mov dx,0
div bx
push dx; save the remainder in stack
inc cx
cmp ax,0
jne division ;if the ax is not zero,means still need ax still need to be divided
ret
output endp
code ENDS
end start
When I directed run the code ,the window can't be closed normally.
When I debug the code ,the subroutine returned ,However the code start from the begining again :(