data segment
data ends
code segment
assume cs:code,ds:data
main proc far
start:
mov ax,data
mov ds,ax
call input
call output
mov ah,4ch
int 21h
main endp
input proc near
mov bx,0
mov ch,2h
newchar:
mov ah,1h
int 21h
sub al,30h
jl exit
cmp al,10d
jl addto
sub al,27h
cmp al,0ah
jl exit
cmp al,10h
jge exit
addto:
mov cl,4
shl bx,cl
mov ah,0
add bx,ax
dec ch
jnz newchar
exit:
ret
input endp
output proc near
mov bh,0h
cmp bl,64H
jc next
mov ax,bx
mov ch,64H
div ch
mov bl,ah
add al,30h
mov dl,al
mov ah,2h
int 21h
next: mov ch,10d
mov ax,bx
div ch
mov bl,ah
add al,30h
mov dl,al
mov ah,2h
int 21h
add bl,30h
mov dl,bl
mov ah,2h
int 21h
ret
output endp
code ends
end main
本文来源:https://www.wddqw.com/doc/4bcc2179f705cc17552709a6.html
正在阅读:
10进制转16进制01-01
男士针织衫品牌排行榜01-01
互相帮助01-01
制定工作计划重要性01-01
沉字组词_沉的组词_沉组词大全01-01
揭露检测监控摄像头质量6大妙招!01-01
《木偶森林》读后感400字01-01
最励志的暖心短句_暖心励志的句子01-01
去日本留学一年最低要多少钱01-01