To write and execute an Assembly language Program (ALP) to 8086 processor to verify the password.

Aim:

To write and execute an Assembly language Program (ALP) to 8086 processor to verify the password.

Tools:

PC installed with TASM

Program:

.MODEL SMALL
.STACK 45H
ASSUME CS : CODE, DS : DATA
DATA SEGMENT
ORG 450H
DB ‘ENTER THE PASSWORD’, ’$’
ORG 500H
DB ‘‘STUDENTBOXOFFICE’,’$’
ORG 550H
DB ‘INCORRECT PASSWORD’, ’$’
ORG 600H
DB ‘PASSWORD IS CORRECT’, ’$’
CR EQU 0DH
DATA SNDS
CODE SEGMENT
START:
AGAIN: MOV AX, DATA
       MOV DS, AX
       MOV AH, 09H
       MOV DX, 450H
       INT 21H
       MOV SI, 400H
       MOV CX 0000H
LP1:   MOV AH, 00H
       INT 16H
       CMP AL, CR
       JE CHECK
       MOV [SI], AL
       MOV AH, 02H
       MOV DL, ‘*’
       INT 21H
       INC SI
       INC CX
       JMP LP1

CHECK: CMP CX, 000BH
       JNE INCORR
       MOV SI, 400H
       MOV DI, 500H
LP2:   MOV AL, [SI]
       CMP AL, [DI]
       JNE INCORR
       INC SI
       INCDI
       LOOP LP2
       MOV AH, 09H
       MOV DX, 600H
       INT 21H
       JMP EXIT
INCORR:MOV AH, 09H
       MOV DX, 550H
       INT 21H
EXIT:  MOV AH, 4CH
       INT 21H
CODE ENDS
END START
END

Result:

ENTER THE PASSWORD
STUDENTBOXOFFICE’
PASSWORD IS CORRECT

Viva-voce questions:

1. What are the DOS function calls?
2. How a CALL instruction will be executed?
3. What is the role of stack?
4. What is the difference between DOS and BIOS interrupts?
5. What is an interrupt vector table of 8086?