- #1
Mastur
- 41
- 0
Homework Statement
We were required to use our surnames as a password to our assembly program. If the user inputs incorrect character or string, an "incorrect password" message will appear. Otherwise, it will display "correct password." The problem is I do not know how to ask several inputs. I was thinking of just checking the input per character and if at a wrong character was typed, it will automatically tell that the password is not correct.
Homework Equations
Which would be easier to understand, string parsing or per character parsing? And is it possible to run that program without TASM?
The Attempt at a Solution
.model small
.stack 64
.data
dict db 'BEAUTIFUL'
uset DB ;this is the line that I do not know what to put
mess1 db "CORRECT PASSWORD!",'$'
mess2 db "INCORRECT PASSWORD!",'$'
.code
main proc far
mov ax,@data
mov ds,ax
mov es,ax
cld
mov si,offset dict
mov di,offset uset
mov cx,09
repe cmpsb
je finish
mov dx,offset mess2
jmp show
finish: mov dx,offset mess1
show: mov ah,09h
int 21h
mov ah,4ch
int 21h
main endp
end main
I was able to grasp the previous lecture since we were only required to integrate simple arithmetic operations of assembly language in C++ program.