从键盘输入字符串按回车后换行输出
ASSUME CS:CODE, DS:DATA
DATA SEGMENT
BUFFER DB 20
DB ?
DB 20 DUP(0)
CRLF DB 0AH, 0DH,'$'
DATA ENDS
CODE SEGMENT
START:
MOV AX, DATA
MOV DS, AX
LEA DX,BUFFER
MOV AH, 0AH
INT 21H
MOV AL, BUFFER+1
ADD AL, 2
MOV AH, 0
MOV SI, AX
MOV BUFFER[SI], '$'
LEA DX, CRLF
MOV AH, 09H
INT 21H
LEA DX, BUFFER+2
MOV AH, 09H
INT 21H
MOV AH, 4CH
INT 21H
CODE ENDS
END START
效果演示: