汇编 字符串输入怎么原样输出

来源:百度知道 编辑:UC知道 时间:2024/06/06 06:09:18
输入一行字符串,然后原样输出。。怎么做?

;汇编 输入字符串,原样输出
;经调试正确
code segment
assume cs:code,ds:code
start:
push cs
pop ds
lea dx,str1
mov ah,9
int 21h;提示
lea dx,str2
mov si,dx
mov ah,0ah
int 21h;输入字符串
mov al,0dh
mov [si],al
mov al,0ah
xchg al,[si+1]
mov ah,0
mov dx,si
cld
mov cx,ax
jcxz Q2
inc cx
inc cx
Q1:lodsb
mov ah,0eh;原样输出
int 10h
loop Q1
Q2:mov ah,1;暂停
int 21h
mov ah,4ch
int 21h

str1 db 'Input a String:',0dh,0ah,'$'
str2 db 0ffh,0,255 dup(0)
code ends
end start

对应的ASCII码~