修改后的输入名字
作者:互联网
修改后的输入名字
DATAS SEGMENT
;此处输入数据段代码
sentence1 DB 0AH,0DH,'INPUT YOUR NAME:','$'
BUF DB 10,?,10 DUP('$')
sentence2 DB 0AH,0DH,'Y/N',0AH,0DH,'$'
DATAS ENDS
STACKS SEGMENT
;此处输入堆栈段代码
STACKS ENDS
CODES SEGMENT
ASSUME CS:CODES,DS:DATAS,SS:STACKS
START:
MOV AX,DATAS
MOV DS,AX
;此处输入代码段代码
BEG:
MOV BX,0
MOV AH,9
LEA DX,sentence1
INT 21H
AGAIN:
MOV AH,1
INT 21H
CMP AL,0DH
JZ EXIT
MOV BUF[BX],AL
INC BX
JMP AGAIN
EXIT:
MOV AH,9
LEA DX,BUF
INT 21H
MOV AH,9
MOV DX,OFFSET sentence2
INT 21H
MOV AH,1
INT 21H
CMP AL,59H
JZ OVER
JMP BEG
OVER:
MOV AH,4CH
INT 21H
CODES ENDS
END START
标签:INT,AH,DATAS,MOV,修改,名字,21H,0DH,输入 来源: https://blog.csdn.net/weixin_48097919/article/details/110490688