大家帮忙看一下这个分支程序啊~~~~~~~~~~~~~~~~~~~~~~~
程序的功能是想输入一个名字,然后判断,N就从头再来,Y就输出yes,问题是再次9号功能时乱码具体如下
DATAS SEGMENT
;此处输入数据段代码
PRINT1 DB 'WHAT IS YOUR NAME?$'
PRINT2 DB '(Y/N)?$'
PRINT3 DB 'YES RIGHT$'
DATAS ENDS
STACKS SEGMENT
;此处输入堆栈段代码
STACKS ENDS
CODES SEGMENT
ASSUME CS:CODES,DS:DATAS,SS:STACKS
START:
MOV AX,DATAS
MOV DS,AX
MOV AH,9
LEA DX,PRINT1
INT 21H
MOV AH,2
MOV DL,13
INT 21H
MOV AH,2
MOV DL,10
INT 21H
MOV AH,10
BUFFER DB 10
DB ?
DB 10 DUP(?)
INT 21H
MOV AH,9
LEA DX,PRINT2
INT 21H
mov dx,0
MOV AH,2
MOV DL,13
INT 21H
MOV AH,2
MOV DL,10
INT 21H
MOV AH,1
MOV DL,AL
INT 21H
let0:
cmp al,'N'
jGE out1
jMP out2
out1:
MOV AH,9
LEA DX,PRINT1
INT 21H
MOV AH,2
MOV DL,13
INT 21H
MOV AH,2
MOV DL,10
INT 21H
MOV AH,10
INT 21H
MOV AH,9
LEA DX,PRINT2
INT 21H
mov dx,0
MOV AH,2
MOV DL,13
INT 21H
MOV AH,2
MOV DL,10
INT 21H
MOV AH,1
MOV DL,AL
INT 21H
out2:
MOV AH,2
MOV DL,13
INT 21H
MOV AH,2
MOV DL,10
INT 21H
MOV AH,9
LEA DX,PRINT3
INT 21H
;此处输入代码段代码
MOV AH,4CH
INT 21H
CODES ENDS
END START