According to my assignment requirement I wrote this program, but still doesn't work......can someone help.....please
Here is my exercise:
"Write assembly code in ASSEMBLY LANGUAGE to read a password from the keyboard. Display the message ' Enter Password: ' and echo each character that the user types as an asterisk(*). If the user types a backspace character ( which enters as the number 8), erase the last character typed by displaying a backspace. a space and another backspace. You shouldn't erase beyond the beginning of the password so you need to keep a count of the asterisks on the screen."
Here is my code
.model small
.586
.stack 100h
INCLUDE C:\MASM615\Programs\PCMAC.INC
.DATA
MSG DB 'Enter Password: $'
PWD DB 'abcd'
Correct db 'Password Correct!$'
WRONG DB 'Password not correct! Please Enter again!$'
.CODE
PASSWORD PROC
START:
mov ax, @DATA
mov ds, ax
mov di, offset pwd
_Begin
_PutStr msg
GetLoop:
_GetCh noEcho
cmp al, 13
je COMPARE
cmp al, 'a'
jnae EchoIt
cmp al, 'z'
jnbe EchoIt
add al, '*'-'a'
cmp al, 8
je BACKSPACE
BACKSPACE:
mov ah, 0Eh
mov al, 8
int 10h
mov al, 32
int 10h
mov al, 8
int 10h
jmp GetLoop
COMPARE:
mov dl, [di]
mov ah, 8h
int 21h
cmp dl, al
je DONE
jmp NOTCORRECT
EchoIt:
_PutCh al
jmp GetLoop
DONE:
_PutStr Correct
_Exit 0
NOTCORRECT:
_PutStr WRONG
jmp START
PASSWORD ENDP
END PASSWORD