OBJECT:
To write a program to check the password.
Program:
.model small
.stack 64h
.data
str1 db "Enter Password",0dh,0ah,'$'
str2 db 0dh,0ah,"Access Denied",'$'
str3 db 0dh,0ah,"Access Approved...",'$'
pass db "khusro",0dh,'$'
count=($-pass)
kbarea label byte
max db 32
charsinput db ?
entword db 32 dup(0)
.code
main proc
mov ax,@data
mov ds,ax
mov es,ax
mov ah,9
lea dx,str1
int 21h
lea dx,kbarea
mov ah,0ah
int 21h
lea si,pass
lea di,entword
mov cx,count
repe cmpsb
jcxz match
lea dx,str2
mov ah,9
int 21h
jmp exit
match: lea dx,str3
mov ah,09
int 21h
exit: mov ax,4c00h
int 21h
main endp
end main
Output:
D:\MASM611\BIN>password.exe
Enter Password
khusro
Access Approved...
No comments:
Post a Comment