Welcome to Dream.In.Code
Getting Help is Easy!

Join 132,147 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,972 people online right now. Registration is fast and FREE... Join Now!




can anyone correct my codes in TASM?

 
Reply to this topicStart new topic

can anyone correct my codes in TASM?, tasm password

ara1026
post 25 Aug, 2008 - 01:25 AM
Post #1


New D.I.C Head

*
Joined: 5 Aug, 2008
Posts: 6

CODE
.model small
.stack 100h
.data
        USRNM   DB"Enter Username:$"
        PWRD    DB "Enter Password:$"
        Ara     DB 30h
        ULIT    DB 30h
        E       DB "Username and Password did not match!$"
        PASSACC DB"Username and Password Accepted!$"
.Code

start:
        mov ax,1h
        mov ds,ax

ULIT2:  mov ax,2h
        int 10h
        mov ah,2h
        mov dx,0405h
        int 10h
        mov ah,9h
        mov dx,offset USRNM
        int 21h
        mov ah,1h
        int 21h
        cmp al,61h
        int 21h
        cmp al,74h
        int 21h
        cmp al,75h
        int 21h
        cmp al,73h
        int 21h
        jle OK
        ULIT1:  jne ULIT2
        ERR1:    mov cx,20
                int 21h
                cmp al,1fh
                jle PASSWORD
        OK:     inc Ara
        PASSWORD:       mov ah,2h
                        mov dx,650h
                        int 10h
                        mov ah,9h
                        mov dx,offset PWRD
                        int 21h
                        mov ah,1h
                        int 21h
                        cmp al,43h
                jne ERR2
                int 21h
                cmp al,4fh
                jne ERR2
                int 21h
                cmp al,41h
                jne ERR2
                int 21h
                cmp al,52h
                jne ERR2
                int 21h
                cmp al,43h
                jne ERR2
                int 21h
                cmp al,1fh
                jle OK2
                ERR2:   mov cx,20h
                        int 21h
                        cmp al,1fh
                        jle OKNBA
                        loop ERR2
                OK2:    inc Ara
                OKNBA:  cmp Ara,32h
                        je OKNA
                        inc ULIT
                        mov ah,2h
                mov dx,080ah
                int 10h
                mov ah,9h
                mov dx,offset E
                int 21h
                cmp ULIT,3
                jne ULIT1
                mov ah,4ch
                int 21h
                ret
                OKNA:   mov ah,2h
                mov dx,080ah
                int 10h
                mov ah,9h
                mov dx,offset PASSACC
                int 21h
                int 20h
end   start



i hope anyone will reply asap...

tnx!!!

god Bless!!
User is offlineProfile CardPM

Go to the top of the page

djkitt
post 3 Sep, 2008 - 02:24 PM
Post #2


D.I.C Head

**
Joined: 22 May, 2008
Posts: 128



Thanked 13 times
My Contributions


So, I took a quick look and I am guessing that this code is sometimes allowing an incorrect username and or password through.

If that is the problem you should look to your use of 'jle' (Jumpto if Less than or Equal) and replace it with 'je' (Jumpto if Equal).

If that is not the problem I will look again if you post more specific information.

Hope this helps...
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 11/21/08 01:05PM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month