汇编语言实现十进制输出
data segments dw 26
data ends
prognam segment
main proc far
assume cs:prognam,ds:data
start:
push ds
sub ax,ax
push ax
mov ax,data
mov ds,ax
begin:
mov ax,s
mov bl,10
div bl
output:
mov dl,al
add dl,30h
mov bl,ah
mov ah,2
int 21h
mov dl,bl
add dl,30h
mov ah,2
int 21h
exit:
mov ah,4ch
int 21h
main endp
prognam ends
end start
一般情况下十进制是一位或两位,按题意输出即可。大可不必试用于所有情况!