Results 1 to 6 of 6

Thread: Assembler Program Help

  1. #1

    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

  2. #2
    Senior Member Wazz's Avatar
    Join Date
    Apr 2003
    Posts
    288
    Try Initialize
    "It is a shame that stupidity is not painful" - Anton LaVey

  3. #3
    AO Curmudgeon rcgreen's Avatar
    Join Date
    Nov 2001
    Posts
    2,716
    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.


    http://www.robelle.com/library/smugbook/ascii.html
    I came in to the world with nothing. I still have most of it.

  4. #4
    Senior Member
    Join Date
    May 2003
    Posts
    407
    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
    \"Look, Doc, I spent last Tuesday watching fibers on my carpet. And the whole time I was watching my carpet, I was worrying that I, I might vomit. And the whole time, I was thinking, \"I\'m a grown man. I should know what goes on my head.\" And the more I thought about it... the more I realized that I should just blow my brains out and end it all. But then I thought, well, if I thought more about blowing my brains out... I start worrying about what that was going to do to my goddamn carpet. Okay, so, ah-he, that was a GOOD day, Doc. And, and I just want you to give me some pills and let me get on with my life. \" -Roy Waller

  5. #5
    Custom User
    Join Date
    Oct 2001
    Posts
    503
    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

  6. #6
    AO Guinness Monster MURACU's Avatar
    Join Date
    Jan 2004
    Location
    paris
    Posts
    1,003
    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.
    \"America is the only country that went from barbarism to decadence without civilization in between.\"
    \"The reason we are so pleased to find other people\'s secrets is that it distracts public attention from our own.\"
    Oscar Wilde(1854-1900)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •