0% found this document useful (0 votes)
35 views5 pages

Program1: Computer Department C0 - 5E Aiarkp

The document contains assembly language code for a login program. The program prompts the user to enter a username and password and compares the input to stored credentials. If the input matches, a success message is displayed. If after three invalid attempts the input does not match, a failure message is shown and the program exits.

Uploaded by

Ubaid Saudagar
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views5 pages

Program1: Computer Department C0 - 5E Aiarkp

The document contains assembly language code for a login program. The program prompts the user to enter a username and password and compares the input to stored credentials. If the input matches, a success message is displayed. If after three invalid attempts the input does not match, a failure message is shown and the program exits.

Uploaded by

Ubaid Saudagar
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

COMPUTER DEPARTMENT

C0 5E

AIARKP

Program1 assume ds : data assume cs : code

data segment msg1 db 10,13, "enter username:$" buff1 db 10,?,10 dup(?) msg2 db 10,13, "enter password:$" buff2 db 10,0,10 dup(?) msg3 db 10,13, "you have logged in successfully$" msg4 db 10,13, "invalid login try again, number of attempts remain:$" msg5 db 10,13, "you have entered invalid username and password 3 times ",10,13,"now the program is exiting$","$" username db "student$" password db "student$" data ends

code segment start: mov ax,data mov ds,ax


Page

mov ax,0000h mov ch,03

1|

COMPUTER DEPARTMENT

C0 5E

AIARKP

st1:

mov ah,09 lea dx,msg1 int 21h

mov ah,0ah lea dx,buff1 int 21h

mov cl,buff1+1 cmp cl,07h jnz inlog

lea si,buff1 + 2 lea di,username

upuser: mov al,[si] cmp al,0d jz down


Page

cmp al,[di] jnz inlog

2|

COMPUTER DEPARTMENT

C0 5E

AIARKP

inc si inc di dec cl jnz upuser

down: mov ah,09 lea dx,msg2 int 21h

mov ah,0ah lea dx,buff2 int 21h

mov cl,buff2+1 cmp cl,07h jnz inlog

lea si,buff2+2 lea di,password

Page

uppass: mov al,[si]


3|

COMPUTER DEPARTMENT

C0 5E

AIARKP

cmp al,0d jz down1 cmp al,[di] jnz inlog inc si inc di dec cl jnz uppass down1: mov ah,09h lea dx,msg3 int 21h jmp exit

inlog: mov ah,09h lea dx,msg4 int 21h

mov bl,ch
Page

mov ah,02h add bl,30h

4|

COMPUTER DEPARTMENT

C0 5E

AIARKP

sub bl,01h mov dl,bl int 21h dec ch jnz st1

mov ah,09 lea dx,msg5 int 21h exit: mov ah,4ch int 21h code ends end start

Page

5|

You might also like