21,459
社区成员
发帖
与我相关
我的任务
分享
.model small
.stack
.data
display db 'Please enter your password:','$'
InvalidMsg db 'Invalid login.Please try again.'
welMsg db 'Welcome to the SaPark Hotel Management System!','$'
pass db 6 DUP (24H),'$'
Rpass db '1231','$'
.code
main proc
mov ax,@data
mov ds,ax
lea si,pass
mov cx,13 ;length of password
mov ah,09h
lea dx,display
int 21h ;show msg
next:
mov ah,07h ;enter password
int 21h
cmp al,0dh
jz safestop
mov [si],al ;store password
inc si
mov ah,02h ;show "*" whan type password
mov dl,'*'
int 21h
dec cx
jnz next
compare:
cmp al,Rpass ;verify password
jz msg
safestop:
mov ah,4ch ;error:expected:instruction or directive
int 21h
msg:
lea dx,InvalidMsg ;show invlid Massenge
mov ah,02h
int 21h
call next
exit:
mov ah,09h
lea dx,pass
int 21h
mov ah,4ch
int 21h
main endp
end main