-
Assembler Program Help
Im writing a password program in assembler but i have a few problems and need some help .
the program works but has some errors ,when you input a wrong character a warning messege reads out on screen .The warning messege work except when you input the } and ] characters ,could someone look at the could and help
;***************L.O.5************************
;**************Andrew****************
.MODEL small
.STACK 100H
.DATA
CR EQU 0dh
LF EQU 0ah
user_input DB 12 DUP(0)
prompt_message DB ' Please enter a new password - ',CR,LF,'$'
error_message_1 DB ' First character must be alphabetic - Re-enter ',CR,LF,'$'
;error_message_2 DB
;error_message_3 DB
.CODE
call initialise
call password_prompt
call check_first
;call check_rest
;call check_length
call exit
initialise proc
mov ax,@data
mov ds,ax
mov bx,OFFSET user_input
ret
initialise endp
password_prompt proc
mov bx, OFFSET user_input
;now put the password message on the screen
mov dx, OFFSET prompt_message
mov ah,9
int 21h
ret
password_prompt endp
mov bx, OFFSET user_input
check_first proc
getfirst:
mov ah, 1
int 21h
cmp al,65
jl error
cmp al,122
jg error
;jmp error still to finish
mov[bx], al
ret
error:
mov dx,OFFSET error_message_1
mov ah,9
int 21h
jmp getfirst
check_first endp
exit proc
mov AH,4Ch
int 21h
exit endp
END
-
-
I don't know why the { curly braces wouldn't flag an error.
but the [ square brackets pass your test for valid characters,
being within the range you tested for.
:cool:
http://www.robelle.com/library/smugbook/ascii.html
-
Well, i dont know assembly, but i see one thing that may cause a problem
Code:
;call check_rest
;call check_length
from other uses of the ; before a statement,i assume it is used for comments. If these two statements are necessary, this is what may be causing the problem. Also, as Wazz said, you spelled initialize wrong a lot.
slick
-
Actually, Cube3k didn't spell initialise (initialize) wrong. There are two spellings of initialise. I'm not sure, but I think that initialize is the American spelling of the word, and being in Scotland, I would spell it initialise.
lol, that was a great post :P
[edit] Here are two links for you:
http://www.dictionary.co.uk/search.p...t=+Look+it+up+
http://www.dictionary.co.uk/search.p...t=+Look+it+up+
They have slightly different meanings (in that initialise has two meanings, and initialize has one). For the way that Cube3k used it, it doesn't matter which way you spell it (unless this post has been a load of crap and initialize is an assembler keyword :P.
[/edit]
ac
-
Gothic
you got there just before me. initialise is the right spelling in english. I know that certain keywords are spelt in american form in certain codes but i am not sure if this is the case in assembler. I am sorry I cant help with the problem but the last time I looked at assembler code was over five years ago.