练习汇编时执行程序时无法输入了

最近在学习汇编,练习编写文件复制的程序,在运行程序的时候到遇到询问是否覆盖时往里输入就不行了,按键盘还噔噔噔的响,这是为什么TAT

源代码如下:
DATA SEGMENT
MSOURCE DB "Please input the path and the source file(***::::.***):",13,10,"$"
MGOAL DB "Please input the path abd the goal file(***:***.***):",13,10,"$"
FERR DB "Cannot open the file currectly!",13,10,"$"
FOK DB "File Open Successed",13,10,"$"
CREERR DB "Cannot creat the file!",13,10,"$"
CROK DB "Creat File Successed!",13,10,"$"
RERR DB "Reading Error!",13,10,"$"
WERR DB "Writing Error!",13,10,"$"
CPS DB "Copy Success!",13,10,"$"
FEX DB "The File has already existed!Are you sure to cover it?(y/n)",13,10,"$" ;y 6E 0110 1111 n 64 0110 0100
NC DB "Copy Stopped!",13,10,"$"
JUG DB 1
DB 0
DB 2 DUP(0) ;判断输入为y还是n
SFNUM DW 0 ;待存源文件号
GFNUM DW 0 ;待存目标文件号
ENUM DW 0 ;待存覆盖文件号
BUFFLEN=50
BUFFER DB BUFFLEN
DB ?
DB BUFFLEN DUP(0)
DATA ENDS

CODE SEGMENT
ASSUME DS:DATA,CS:CODE
START:
MOV AX,DATA
MOV DS,AX

    LEA DX,MSOURCE
    CALL PRINT      ;提示输入源文件路径

    MOV DX,OFFSET BUFFER
    MOV AH,0AH
    INT 21H         ;输入源文件路径

    LEA SI,BUFFER
    MOV AL,[SI+1]
    XOR AH,AH
    ADD SI,2
    ADD SI,AX
    MOV BYTE PTR[SI],0      ;将输入文件名的最后一个回车符换成0

    MOV DX,OFFSET BUFFER+2
    MOV AH,3DH
    INT 21H     ;打开源文件

    JNC OPENOK  ;打开成功跳至OPENOK
    JC FRJ  ;若打开出错,CF进位,跳至FERROR提示出错

    OPENOK:
        MOV SFNUM,AX        ;将源文件号存入SFNUM

        MOV DX,OFFSET FOK
        CALL PRINT      ;提示源文件打开成功

        MOV DX,OFFSET MGOAL
        CALL PRINT      ;提示输入目的路径

        MOV DX,OFFSET BUFFER
        MOV AH,0AH
        INT 21H     ;输入目的路径

        LEA SI,BUFFER
        MOV AL,[SI+1]
        XOR AH,AH
        ADD SI,2
        ADD SI,AX
        MOV BYTE PTR[SI],0

        MOV DX,OFFSET BUFFER+2
        MOV AH,3DH
        INT 21H     ;查看目的路径中是否已有可打开的该文件

        JNC EXIST
        JC NOTEXIST     ;如果不存在直接创建

    EXIST:
        MOV ENUM,AX
        MOV BX,ENUM
        MOV AH,3EH
        INT 21H     ;关闭待覆盖文件

        LEA DX,FEX
        CALL PRINT

        MOV DX,OFFSET JUG
        MOV AH,0AH
        INT 21H

        LEA SI,JUG
        MOV AL,[SI+1]
        XOR AH,AH
        ADD SI,2
        ADD SI,AX
        MOV BYTE PTR[SI],0

        MOV AL,JUG+2
        AND AL,1
        MOV AH,AL
        SAHF

        JC DEL      ;若输入为y则跳至DEL先删除
        FRJ:JC FERROR

        LEA DX,NC
        CALL PRINT
        JMP START

    DEL:
        MOV DX,OFFSET BUFFER+2
        MOV AH,41H
        INT 21H     ;删除已存在文件

    NOTEXIST:
        MOV DX,OFFSET BUFFER+2
        MOV CX,0
        MOV AH,3CH
        INT 21H     ;在目标路径建立文件

        JNC CREOK       ;若创建成功跳至CREOK
        JC CREERROR     ;若创建出错,CF进位,跳至CREERROR关闭文件并提示出错

    CREOK:
        MOV GFNUM,AX        ;将目的文件号存入GFNUM  

        LEA DX,CROK
        CALL PRINT

    COPY_CONT:
        MOV DX,OFFSET BUFFER
        MOV CX,BUFFLEN
        MOV BX,SFNUM
        MOV AH,3FH
        INT 21H     ;读源文件

        JC RERROR       ;若读文件出错,跳至RERROR提示读文件出错

        OR AX,AX        ;循环相或直至已到文件尾,进位标志CF清零
        JZ COPYOK       ;复制完成,循环结束

        MOV CX,AX       ;写入的字节数录入
        MOV BX,GFNUM        ;目的文件号录入
        MOV AH,40H      
        INT 21H     ;写文件

        JC WERROR       ;若写文件出错,跳至WERROR提示写文件出错

        JMP COPY_CONT       ;继续循环

    FERROR:
        LEA DX,FERR
        CALL PRINT
        JMP EXIT

    CREERROR:
        MOV BX,SFNUM
        MOV AH,3EH
        INT 21H     ;关闭源文件

        LEA DX,CREERR
        CALL PRINT
        JMP EXIT

    WERROR:
        LEA DX,WERR
        CALL PRINT
        JMP EXIT

    RERROR:
        LEA DX,RERR
        CALL PRINT
        JMP EXIT

    PRINT PROC NEAR
        MOV AH,09H
        INT 21H
        RET
    PRINT ENDP

    COPYOK:
        MOV BX,SFNUM
        MOV AH,3EH
        INT 21H     ;关闭源文件
        MOV BX,GFNUM
        MOV AH,3EH
        INT 21H     ;关闭目标文件

        LEA DX,CPS
        CALL PRINT

    EXIT:
        MOV AX,4C00H
        INT 21H

CODE ENDS
END START

图片说明
如图,到这一步就输不进去了,求指点QAQ

查看全部
hkr669877
炖蛋白豆腐
2016/07/07 13:16
  • 点赞
  • 收藏
  • 回答
    私信

1个回复