|
-
January 18th, 2004, 09:00 PM
#1
Member
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|