data segment
max_len db 10
real_len db ?
buf_str db 10 dup(0)
CRLF DB 0AH,0DH,"$";
data endscode segment
assume cs:code,ds:data
start: mov ax,data
mov ds,ax
xor ax,axmov dx,offset max_len;输入
mov ah,10
int 21hmov bx,offset buf_str;去掉输入的最后一个回车字符,避免遮住已显示字符
add bl,real_len
adc bh,0
mov byte ptr[bx],20hmov dx,offset buf_str;输出字符串
mov ah,09
int 21hmov ax,4c00h
int 21hcode ends
end start
汇编 输入输出字符串(最简单版),布布扣,bubuko.com
时间: 2024-12-28 10:44:17