输入字符串与已知字符串比较:输入CORRECT,则输出:ok!否则:Error.Input again.
(下面哪里错了,各位高手帮忙看下)
DATAS SEGMENT
STR DB"please input the password:$"
BUF DB 20
DB ?
DB 20 DUP (?)
CRLF DB 0AH,0DH,"$"
STR2 DB 'CORRECT'
STR3 DB"Error!Input again:$"
COUNT EQU $-STR2
DATAS ENDS
CODES SEGMENT
ASSUME CS:CODES,DS:DATAS,ES:DATAS
START: MOV AX,DATAS
MOV DS,AX
MOV ES,AX
LEA DX,STR
MOV AH,9
INT 21H
MOV AH,10
LEA DX,BUF
INT 21H
LEA DX,CRLF
MOV AH,9
INT 21H
LEA SI,BUF+2
LEA DI,STR2
MOV CX,COUNT
CLD
REPE CMPSB
jnz no
mov dl,'O'
mov ah,02h
int 21h
MOV DL,'K'
INT 21H
MOV DL,'!'
MOV AH,02H
INT 21H
jmp pend
no:
LEA DX,STR3
MOV AH,9
INT 21H
pend:
MOV AH,4CH
INT 21H
CODES ENDS
END START
[此贴子已经被作者于2007-6-12 0:40:43编辑过]