Vous êtes sur la page 1sur 84

EC8681(CSE&IT) MICROPROCESSORS AND MICROCONTROLLERS

LABORATORY

Experiment Number: 1

Title of the experiment : ADDITION OF TWO BYTE USING 8086

Date of the experiment :

OBJECTIVE (AIM) OF THE EXPERIMENT

To write an assembly language program to addition of two byte using 8086 and store the
result in memory.

APPARATUS REQUIRED

Sl.No. Facilities Required Quantity


1 8086 Microprocessor Kit 1
2 Keyboard 1

ALGORITHAM:

 Start the program

 Initialize Ax register

 Initialize Bx register

 Do addition operation

 Store in Ax register

 Stop the program

PROGRAM:

ADDRESS OPCODE LABEL MNEMONICS COMMENTS


8000 BE 00 85 MOV SI,8500 ADDRESS IN SI AS 8500
8003 AD LODSW LOAD THE FIRST DATA
8004 89 C3 MOV BX,AX
8006 AD LODSW LOAD THE SECOND DATA
8007 01 C3 ADD BX,AX ADD TWO DATA
8009 BF 20 85 MOV DI,8520 ADDRESS IN DI AS 8520 FOR
STORING RESULT
800C 89 1D MOV [DI],BX RESULT IN 8520
1
EC8681(CSE&IT) MICROPROCESSOR & MICROCONTROLLER LAB

OUTPUT:
INPUT OUTPUT
800E END
ADDRESS DATA ADDRESS DATA
8500 8520

8501 8521
8502
CC INT 3

8503

2
EC8681(CSE&IT) MICROPROCESSORS AND MICROCONTROLLERS
LABORATORY

RESULT

Experiment Number: 2

Title of the experiment : SUBTRACTION OF TWO BYTE DATA USING 8086

Date of the experiment :

OBJECTIVE (AIM) OF THE EXPERIMENT

To write an assembly language program to subtraction of two byte data using 8086 and
store the result in memory.

APPARATUS REQUIRED

Sl.No. Facilities Required Quantity


1 8086 Microprocessor Kit 1
2 Keyboard 1

ALGORITHM:

 Start the program

 Initialize Ax register

 Initialize Bx register

 Do subtraction operation

 Store in Ax register

 Stop the program

PROGRAM:

ADDRESS OPCODE LABEL MNEMONICS COMMENTS


3
EC8681(CSE&IT) MICROPROCESSOR & MICROCONTROLLER LAB

OUTPUT:
INPUT OUTPUT
8000 ADDRESS
ADDRESS DATA ADDRESS DATA
IN SI AS
8500 8520
8500

8501 8521
8502
BE 00 85 MOV SI,8500
8003 AD LODSW LOAD THE FIRST DATA
8004 89 C3 MOV BX,AX
8006 AD LODSW LOAD THE SECOND DATA
8007 29 D8 SUB BX,AX SUBTRACT TWO DATA
8009 BF 20 85 MOV DI,8520 ADDRESS IN DI AS 8520 FOR
STORING RESULT
800C 89 05 MOV [DI],BX RESULT IN 8520
800E CC INT 3 END

8503

4
EC8681(CSE&IT) MICROPROCESSORS AND MICROCONTROLLERS
LABORATORY

RESULT

5
IT6411 & CS6412 MICROPROCESSOR & MICROCONTROLLER LAB

OUTPUT:
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
8500 8520

8501 8521
8502
3
MULTIPLICATION OF TWO BYTE DATA USING 8086
Date of the experiment :

OBJECTIVE (AIM) OF THE EXPERIMENT


To write an assembly language program to multiplication of two byte data using 8086
and store the result in memory.

APPARATUS REQUIRED

Sl.No. Facilities Required Quantity


1 8086 Microprocessor Kit 1
2 Keyboard 1
ALGORITHM:

 Start the program

 Initialize Ax register

 Initialize Bx register

 Do multiplication operation

 Store in Ax register

 Stop the program

PROGRAM:

ADDRESS OPCODE LABEL MNEMONICS COMMENTS


8000 BE 00 85 MOV SI,8500 ADDRESS IN SI AS 8500
8003 AD LODSW LOAD THE FIRST DATA
8004 89 C3 MOV BX,AX
8006 AD LODSW LOAD THE SECOND DATA
8007 F7 E3 MUL BX MULTIPLY TWO DATA
8009 BF 20 85 MOV DI,8520 ADDRESS IN DI AS 8520 FOR
STORING RESULT
6
IT6411 & CS6412 MICROPROCESSOR & MICROCONTROLLER LAB

Experiment Number:

Title of the experiment :

800C 89 05 MOV [DI],AX RESULT IN 8520


800E 47 INC DI INCREMENT DI
800F 47 INC DI INCREMENT DI
8010 89 15 MOV [DI],DX STORE ADDITIONAL LAST 2BYTE
DATA IN 8522
800E CC INT 3 END

8503

7
IT6411 & CS6412 MICROPROCESSOR & MICROCONTROLLER LAB

OUTPUT:
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
8500 8520

8501 8521
8502

RESULT
4
DIVISION USING 8086 Date
of the experiment :

OBJECTIVE (AIM) OF THE EXPERIMENT


To write an assembly language program to divide two 16-bit numbers using 8086 and
store the result in memory.

APPARATUS REQUIRED

Sl.No. Facilities Required Quantity


1 8086 Microprocessor Kit 1
2 Keyboard 1
ALGORITHM:

 Start the program

 Initialize Ax register

 Initialize Bx register

 Do division operation

 Store in Ax register

 Stop the program

PROGRAM

ADDRESS OPCODE LABEL MNEMONICS COMMENTS


8000 BA 00 00 MOV DX,0000 CLEAR DX REGISTER
8003 B8 0A 00 MOV AX,0A00 LOAD THE DIVIDEND IN AX
8006 B9 02 00 MOV CX,0200 LOAD THE DIVISOR IN CL
8009 F7 F1 DIV CX

8
IT6411 & CS6412 MICROPROCESSOR & MICROCONTROLLER LAB

Experiment Number:

Title of the experiment :

800B BF 00 85 MOV DI,8500 ADDRESS IN DI AS 8500 FOR


STORING RESULT
800E 88 05 MOV [DI],AL STORE QUOTIENT
8010 47 INC DI INCREMENT DI
8011 88 25 MOV [DI],AH
8013 47 INC DI INCREMENT DI
8014 89 15 MOV [DI],DX STORE THE REMINDER
800E CC INT 3 END

9
IT6411 & CS6412 MICROPROCESSOR & MICROCONTROLLER LAB
OUTPUT:
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
8504 8500

8507 8502

RESULT
5
AVERAGE OF AN ARRAY USING 8086 Date
of the experiment :
10
IT6411 & CS6412 MICROPROCESSOR & MICROCONTROLLER LAB

Experiment Number:

Title of the experiment :

OBJECTIVE (AIM) OF THE EXPERIMENT


To write an assembly language program to average of an array using 8086

APPARATUS REQUIRED

Sl.No. Facilities Required Quantity


1 8086 Microprocessor Kit 1
2 Keyboard 1

PROGRAM

ADDRESS OPCODE LABEL MNEMONICS COMMENTS


8000 BB 00 00 MOV BX,0000 CLEAR BX REGISTER
8003 BE 00 90 MOV SI,9000 ARRAY START ADDRESS
8006 B8 00 00 MOV AX,0000
8009 B1 06 MOV CL,06 COUNT=6
800B 88 CD MOV CH,CL SAVE THE COUNT

800D 8A 1C LOOP MOV BL,[SI]


GET THE DATA BYTE
800F 00 D8 ADD AL,BL ADD THE DATA BYTE
8011 46 INC SI
8012 FE C9 DEC CL CHECK THE COUNT
8014 75 F7 JNZ 800D(LOOP) IF COUNT IS NOT ZERO THEN GO
TO LOOP
8016 F6 F5 DIV CH FIND THE AVERAGE BY
SUM/COUNT
8018 CC INT 3 END

11
IT6411 & CS6412 MICROPROCESSOR & MICROCONTROLLER LAB

OUTPUT:
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
9000
9001
9002
9003
9004
9005

12
IT6411 & CS6412 MICROPROCESSOR & MICROCONTROLLER LAB

Experiment Number:

Title of the experiment :

RESULT

6
SUM OF N CONSECUTIVE NUMBERS USING 8086 Date
of the experiment :

OBJECTIVE (AIM) OF THE EXPERIMENT


To write an assembly language program to find sum of n consecutive numbers using 8086
and store the result in memory.

APPARATUS REQUIRED

Sl.No. Facilities Required Quantity


1 8086 Microprocessor Kit 1
2 Keyboard 1

PROGRAM

ADDRESS OPCODE LABEL MNEMONICS COMMENTS


8000 B1 04 MOV CL,04 load cl with value n
8002 B0 00 MOV AL,00
8004 B3 01 MOV BL,01
8006 00 D8 LOOP ADD AL,BL add previous and next value
8008 FE C3 INC BL
800A FE C9 DEC CL loop ececutes until the desired vale
of n is reached
800C 75 F8 JNZ 8006(LOOP)
800E BF 00 85 MOV DI,8500 STORE RESULT IN 8500

13
IT6411 & CS6412 MICROPROCESSOR & MICROCONTROLLER LAB
8011 89 05 MOV [DI],AX
8013 CC INT 3 END

OUTPUT:

INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
8001 8500

14
IT6411 & CS6412 MICROPROCESSOR & MICROCONTROLLER LAB

Experiment Number:

Title of the experiment :

RESULT

7
MOVE A DATA BLOCK USING 8086 Date
of the experiment :

OBJECTIVE (AIM) OF THE EXPERIMENT


To write an assembly language program to move a data block from one location to
another using 8086 and store the result in memory.

APPARATUS REQUIRED

Sl.No. Facilities Required Quantity


1 8086 Microprocessor Kit 1
2 Keyboard 1
ALGORITHM:

 Move the array of data to SI

 Move the array of data to destination SI reg


15
IT6411 & CS6412 MICROPROCESSOR & MICROCONTROLLER LAB
 Move the array of data to DI reg

 Move the count value to Cx reg

 Move the string byte

 Stop the program

PROGRAM

ADDRESS OPCODE LABEL MNEMONICS COMMENTS


8000 B1 08 MOV CL,08 number of byte to be moved in CL
8002 BE 00 85 MOV SI,8500 address in SI as 8500 for storing data
8005 BF 50 85 MOV DI,8550 address in DI as 8550 for storing data
8008 AC LOOP LODSB load the data in AL register
8009 88 05 MOV [DI],AL store the result in specified location
800B 47 INC DI increment the pointer
800C FE C9 DEC CL DECREMENT THE COUNTER
800E 75 F8 JNZ 8008(LOOP) loop continues until counter is zero
8010 CC INT 3 END

OUTPUT:
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA

16
IT6411 & CS6412 MICROPROCESSOR & MICROCONTROLLER LAB

Experiment Number:

Title of the experiment :

RESULT

8
BCD TO HEXADECIMAL CONVERSION USING 8086
Date of the experiment :

17
IT6411 & CS6412 MICROPROCESSOR & MICROCONTROLLER LAB
OBJECTIVE (AIM) OF THE EXPERIMENT
To write an assembly language program to BCD to Hexadecimal conversion using 8086
and store the result in memory.

APPARATUS REQUIRED

Sl.No. Facilities Required Quantity


1 8086 Microprocessor Kit 1
2 Keyboard 1

PROGRAM

ADDRESS OPCODE LABEL MNEMONICS COMMENTS


8000 B0 10 MOV AL,10 load register AL with data
8002 88 C4 MOV AH,AL
8004 80 E4 0F AND AH,0F mask higher bits
8007 88 E3 MOV BL,AH
8009 24 F0 AND AL,F0 mask lower bits
800B B1 04 MOV CL,04
800D D2 C8 ROR AL,CL rotate the data from last 4bits to first
4bits
800F B7 0A MOV BH,0A
8011 F6 E7 MUL BH multiply by 10
8013 00 D8 ADD AL,BL add lower nibble to the multiplied
data
8015 CC INT 3 end

OUTPUT:
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
8001 8001

RESULT:

18
IT6411 & CS6412 MICROPROCESSOR & MICROCONTROLLER LAB

Experiment Number:

Title of the experiment :

Experiment Number: 9

Title of the experiment :HEXADECIMAL TO ASCII CONVERSION USING 8086

Date of the experiment :

OBJECTIVE (AIM) OF THE EXPERIMENT

To write an assembly language program to Hexadecimal to ASCII conversion using 8086


and store the result in memory.

APPARATUS REQUIRED

Sl.No. Facilities Required Quantity


1 8086 Microprocessor Kit 1
2 Keyboard 1

PROGRAM

ADDRESS OPCODE LABEL MNEMONICS COMMENTS


8000 B0 0A MOV AL,0A load register AL with data
8002 3C 09 CMP AL,09 if data less than 9 add 30 to the data
8004 74 04 JZ 800A(LOOP 1)
8006 72 02 JB 800A(LOOP 1) else add 7 and add 30 with the data
8008 04 07 ADD AL,07
800A 04 30 LOOP 1 ADD AL,30
8015 CC INT 3 end

OUTPUT:
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
8001 8001

19
IT6411 & CS6412 MICROPROCESSOR & MICROCONTROLLER LAB

RESULT:

20
IT6411 & CS6412 MICROPROCESSOR & MICROCONTROLLER LAB

Experiment Number: 10

Title of the experiment : ASCII TO HEXADECIMAL CONVERSION USING 8086

Date of the experiment :

OBJECTIVE (AIM) OF THE EXPERIMENT

To write an assembly language program to ASCII to Hexadecimal conversion using 8086


and store the result in memory.

APPARATUS REQUIRED

Sl.No. Facilities Required Quantity


1 8086 Microprocessor Kit 1
2 Keyboard 1

PROGRAM

ADDRESS OPCODE LABEL MNEMONICS COMMENTS


8000 B0 31 MOV AL,31 load register AL with data
8002 2C 30 SUB AL,30 subtract 30 with the AL
8004 3C 10 CMP AL,10 if data is less than or equal to 16 go
to 800C
JB 800C(LOOP 1)
8006 72 04
8008 74 02 JZ 800C(LOOP 1)
800A 2C 07 SUB AL,07 Else subtract 7 from AL
8015 CC LOOP 1 INT 3 end

OUTPUT:
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
8001 8001

RESULT:
21
IT6411 & CS6412 MICROPROCESSOR & MICROCONTROLLER LAB

Experiment Number: 11

Title of the experiment : DESCENDING ORDER USING 8086

Date of the experiment :

OBJECTIVE (AIM) OF THE EXPERIMENT

To write an assembly language program to sorting an given array in descending order


using 8086 and store the result in memory.

APPARATUS REQUIRED

Sl.No. Facilities Required Quantity


1 8086 Microprocessor Kit 1
2 Keyboard 1
ALGORITHM:

 Start the program

 Move the content to SI

 Move SI to CL reg

 Decrement CL reg

 Move data to SI

 Decrement CH register

 Increment SI register

 Move SI to register

 Jump if carry to a head

 Exchange AL to BL register l

 Jump if no zero means return


22
IT6411 & CS6412 MICROPROCESSOR & MICROCONTROLLER LAB
 Stop the program

PROGRAM

ADDRESS OPCODE LABEL MNEMONICS COMMENTS


8000 BE 00 90 MOV SI,9000
8003 8A 0C MOV CL,[SI] Number of comparison in CL
8005 BE 00 90 LOOP 4 MOV SI 9000
8008 8A 14 MOV DL,[SI] Get the count
800A 46 INC SI
800B 8A 04 MOV AL,[SI] First data in al
800D FE CA DEC DL
800F 46 LOOP 3 INC SI
8010 8A 1C MOV BL,[SI] Second data in bl
8012 38 D8 CMP AL,BL
8014 72 07 JB 801D(LOOP 1)
8016 4E DEC SI If al>bl got to (jump 1)
8017 88 04 MOV [SI],AL Store the greatest data
8019 88 D8 MOV AL,BL
801B EB 03 JMP 8020(LOOP 2)
801D 4E LOOP 1 DEC SI
801E 88 1C MOV [SI],BL Store the smallest data in memory
8020 46 LOOP 2 INC SI
8021 FE CA DEC DL
8023 75 EA JNZ 800F(LOOP 3)
8025 88 04 MOV [SI],AL
8027 FE C9 DEC CL
8029 75 DA JNZ 8005(LOOP 4)
8015 CC INT 3 end

23
IT6411 & CS6412 MICROPROCESSOR & MICROCONTROLLER LAB

OUTPUT:
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
9000 9000

9001 9001
90029 90029
9003 9003
9004 9004
9005 9005
9006 9006
9007 9007
9008 9008
9009 9009

RESULT:

24
IT6411 & CS6412 MICROPROCESSOR & MICROCONTROLLER LAB

Experiment Number: 12

Title of the experiment : ASCENDING ORDER USING 8086

Date of the experiment :

OBJECTIVE (AIM) OF THE EXPERIMENT

To write an assembly language program to sorting an given array in ascending order using
8086 and store the result in memory.

APPARATUS REQUIRED

Sl.No. Facilities Required Quantity


1 8086 Microprocessor Kit 1
2 Keyboard 1

ALGORITHM:

 Start the program

 Move the content to SI

 Move SI to CL reg

 Decrement CL reg

 Move data to SI

 Decrement CH register

 Increment SI register

 Move SI to register

 Jump if carry to a head

 Exchange AL to BL register l
25
IT6411 & CS6412 MICROPROCESSOR & MICROCONTROLLER LAB
 Jump if no zero means return

 Stop the program

PROGRAM

ADDRESS OPCODE LABEL MNEMONICS COMMENTS


8000 BE 00 90 MOV SI,9000
8003 8A 0C MOV CL,[SI] Number of comparison in CL
8005 BE 00 90 LOOP 4 MOV SI 9000
8008 8A 14 MOV DL,[SI] Get the count
800A 46 INC SI
800B 8A 04 MOV AL,[SI] First data in al
800D FE CA DEC DL
800F 46 LOOP 3 INC SI
8010 8A 1C MOV BL,[SI] Second data in bl
8012 38 D8 CMP AL,BL
8014 73 07 JNB 801D(LOOP 1)
8016 4E DEC SI If al>bl got to (jump 1)
8017 88 04 MOV [SI],AL Store the greatest data
8019 88 D8 MOV AL,BL
801B EB 03 JMP 8020(LOOP 2)
801D 4E LOOP 1 DEC SI
801E 88 1C MOV [SI],BL Store the smallest data in memory
8020 46 LOOP 2 INC SI
8021 FE CA DEC DL
8023 75 EA JNZ 800F(LOOP 3)
8025 88 04 MOV [SI],AL
8027 FE C9 DEC CL
8029 75 DA JNZ 8005(LOOP 4)
8015 CC INT 3 end

26
IT6411 & CS6412 MICROPROCESSOR & MICROCONTROLLER LAB

OUTPUT:
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
9000 9000

9001 9001
90029 90029
9003 9003
9004 9004
9005 9005
9006 9006
9007 9007
9008 9008
9009 9009

RESULT:

27
IT6411 & CS6412 MICROPROCESSOR & MICROCONTROLLER LAB

28
IT6411 & CS6412 MICROPROCESSOR & MICROCONTROLLER LAB
Experiment Number:

Title of the experiment

13
: SEARCHING LARGEST NUMBER USING 8086 Date
of the experiment :

OBJECTIVE (AIM) OF THE EXPERIMENT


To write an assembly language program to searching a largest number in an given array
using 8086 and store the result in memory.

APPARATUS REQUIRED

Sl.No. Facilities Required Quantity


1 8086 Microprocessor Kit 1
2 Keyboard 1
ALGORITHM:

 Start the program

 Move the content to SI

 Move SI to CL register

 Decrement CL register

 Move data to SI

 Decrement CH register

 Increment SI register

 Move SI to register

 Jump if carry to a head

 Exchange AL to BL register l

 Jump if no zero means return

 Stop the program

29
IT6411 & CS6412 MICROPROCESSOR & MICROCONTROLLER LAB
Experiment Number:

Title of the experiment

PROGRAM

ADDRESS OPCODE LABEL MNEMONICS COMMENTS


8000 BE 00 90 MOV SI,9000
8003 8A 0C MOV CL,[SI] Number of count
8005 46 INC SI
8006 8A 04 MOV AL,[SI] move the first data in AL
8008 FE C9 DEC CL reduce the count
800A 46 LOOP 2 INC SI move the SI ptr to next data
800B 3A 04 CMP AL,[SI]
800D 73 02 JNB 8011(LOOP1) if AL>[SI] then go to jump1
800F 8A 04 MOV AL,[SI] else store large no in to AL
8011 FE C9 LOOP1 DEC CL Decrement The Count
8013 75 F5 JNZ 800A(LOOP 2) If Count Is Not Zero Go To Next
8015 BF 00 95 MOV DI,9500 Else Store The Biggest Number At
9500
8018 88 05 MOV [DI],AL
8015 CC INT 3 end

OUTPUT:
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
9000 9500
9001
9002
9003
9004
9005
9006
9007
9008
9009

30
IT6411 & CS6412 MICROPROCESSOR & MICROCONTROLLER LAB

RESULT:

14
: SEARCHING A SMALLEST NUMBER USING 8086 Date
of the experiment :

OBJECTIVE (AIM) OF THE EXPERIMENT


To write an assembly language program to searching a smallest number in an given array
using 8086 and store the result in memory.

APPARATUS REQUIRED

Sl.No. Facilities Required Quantity


1 8086 Microprocessor Kit 1
2 Keyboard 1

PROGRAM

ADDRESS OPCODE LABEL MNEMONICS COMMENTS


8000 BE 00 90 MOV SI,9000
8003 8A 0C MOV CL,[SI] Number of count
8005 46 INC SI
8006 8A 04 MOV AL,[SI] move the first data in AL
8008 FE C9 DEC CL reduce the count
800A 46 LOOP 2 INC SI move the SI ptr to next data
800B 3A 04 CMP AL,[SI]
800D 73 02 JB 8011(LOOP1) if AL>[SI] then go to jump1

800F 8A 04 MOV AL,[SI] else store large no in to AL

31
IT6411 & CS6412 MICROPROCESSOR & MICROCONTROLLER LAB
Experiment Number:

Title of the experiment

8011 FE C9 LOOP1 DEC CL Decrement The Count


8013 75 F5 JNZ 800A(LOOP2) If Count Is Not Zero Go To Next
8015 BF 00 95 MOV DI,9500 Else Store The Biggest Number At
8018 88 05 MOV [DI],AL 9500
8015 CC INT 3 end

OUTPUT:
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
9000 8500
9001
90029
9003
9004
9005
9006
9007
9008
9009

32
IT6411 & CS6412 MICROPROCESSOR & MICROCONTROLLER LAB

RESULT:

15
: MATRIX ADDITION USING 8086 Date
of the experiment :

OBJECTIVE (AIM) OF THE EXPERIMENT


To write an assembly language program to perform matrix addition using 8086 and store
the result in memory.

APPARATUS REQUIRED

Sl.No. Facilities Required Quantity


1 8086 Microprocessor Kit 1
2 Keyboard 1
ALGORITHM:

 Load the address of input matrix in BX register

 Load the base address of input matrix 2 in BD reg

33
IT6411 & CS6412 MICROPROCESSOR & MICROCONTROLLER LAB
Experiment Number:

Title of the experiment

 Set BI register on index for elements of the matrix

 Set DI register as printer for sum matrix

 Load the count value of CL register

 Get an element of the first matrix in AL reg

 Add the corresponding element of second matrix to AL register

 Store the sum in memory increment the SI and DI reg

 Repeat step 6 to 9 untill the count value in CL register is zero

 Stop the program

PROGRAM

ADDRESS OPCODE LABEL MNEMONICS COMMENTS


8000 B1 09 MOV CL,09 count for 3x3 matrix addition
8002 BE 00 90 MOV SI,9000 Storing the Data Of First Matrix
8005 BF 00 85 MOV DI,8500 Storing the Data Of Second Matrix
8008 8A 04 MOV AL,[SI] Load AL With Data Of First Matrix
MOV BL,[DI] Load AL With Data Of Second
800A 8A 1D Matrix
800C 00 D8 ADD AL,BL Add Two Data
800E 88 05 MOV [DI],AL Store Result
8010 47 INC DI

8011 46 INC SI
8012 FE C9 DEC CL
8014 75 F2 JNZ 8008 Loop Continues Until All Elements
Of The Matrix Are Added
8015 CC INT 3 end

34
IT6411 & CS6412 MICROPROCESSOR & MICROCONTROLLER LAB
OUTPUT:

INPUT OUTPUT
ADDRESS DATA ADDRESS DATA ADDRESS DATA
9000 8500 8500
9001 8501 8501
9 8502 8502
9002
9003 8503 8503
9004 8504 8504

9005 8505 8505


9006 8506 8506
9007 8507 8507
9008 8508 8508

RESULT:

35
IT6411 & CS6412 MICROPROCESSOR & MICROCONTROLLER LAB

Experiment Number: 16

Title of the experiment : ONE’S COMPLEMENT OF A NUMBER USING 8086

Date of the experiment :

OBJECTIVE (AIM) OF THE EXPERIMENT

To write an assembly language program to perform 1’s Complement of a number using


8086 and store the result in memory.

APPARATUS REQUIRED

Sl.No. Facilities Required Quantity


1 8086 Microprocessor Kit 1
2 Keyboard 1

PROGRAM

Memory Opcode Label Mnemonics Command


address

8000 8B,06,34,12 Mov AX,[1234] Move Data To A-Register

8004 F7,D0 NOT AX Perform The Not Operation

8006 89,06,00,14 Mov [8400],AX Store The Result In Ax Register

800A F4 HLT Stop The Program

OUTPUT:
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA

RESULT:
36
IT6411 & CS6412 MICROPROCESSOR & MICROCONTROLLER LAB

Experiment Number: 17

Title of the experiment : MOVE A DATA BLOCK USING MASM

Date of the experiment :

OBJECTIVE (AIM) OF THE EXPERIMENT

To write an assembly language program to move a data block from one location to
another using MASM and store the result in memory.

APPARATUS REQUIRED

Sl.No. Facilities Required Quantity


1 MASM SOFTWARE 1
2 PERSONAL COMPUTER 1

PROGRAM
.MODEL SMALL
.DATA
Array1 DW 1111h,2222h,3333h,4444h,5555h Array2 DW 5
DUP (0)
Count DW 0005H
.CODE
MOV AX,@DATA
MOV DS,AX
LEA SI,Array1
LEA DI,Array2
MOV CX,Count

37
NEXT: MOV AX,[SI]
MOV [DI],AX
INC SI INC SI
INC DI
INC DI
LOOP NEXT

MOV AH,4Ch
INT 21h
END

RESULT
IT6411 & CS6412 MICROPROCESSOR & MICROCONTROLLER LAB
IT6411 & CS6412 MICROPROCESSOR & MICROCONTROLLER LAB
Experiment Number: 18

Title of
the experiment : STRING MANIPULATION

Date of the experiment :

1) Moving Block Of Data From One Memory Location To Another Memory Location

AIM: To write an alp for transfer block of data from one memory location to another memory
location. APPARATUS:

1.8086 microprocessor kit/MASM ----1

2.KEYBOARD ----1

3.PERSONAL COMPUTER -----1

PROGRAM:
A) By using MASM: ASSUME CS:
CODE

CODE SEGMENT

START: MOV SI, 2000

MOV DI, 2008

MOV CX, 0008

REP

MOVSB

INT 03

CODE ENDS

END START

39
IT6411 & CS6412 MICROPROCESSOR & MICROCONTROLLER LAB B)
By using 8086 kit:
MEMORY OP-CODE LABEL MNEMONIC
LOCATION
4000 MOV SI,2000
MOV DI,2008
MOV CX,0008
REP
MOVSB
INT 3

OUTPUT:
Input output
MEMORY Data MEMORY Data
LOCATION LOCATION
IT6411 & CS6412 MICROPROCESSOR & MICROCONTROLLER LAB
2) REVERSE OF A DATA:
AIM: To write a alp for reverse of a given string

APPARATUS:

1. 8086 microprocessor kit/MASM ----1

2. KEYBOARD ----1

3. PERSONAL COMPUTER -----1

PROGRAM:
A) By using MASM: ASSUME CS:
CODE

CODE SEGMENT

START: MOV SI, 2000


MOV DI, 2008
MOV CX, 0008
ADD SI, 07
UP: MOV AL, [SI]
MOV [DI], AL

DEC SI

INC DI

DEC CX

JNZ UP

INT 3
CODE ENDS
END START
IT6411 & CS6412 MICROPROCESSOR & MICROCONTROLLER LAB B)
By using 8086 kit:
MEMORY OP-CODE LABEL MNEMONIC
LOCATION
4000 MOV SI,2000
MOV DI,2008
MOV CX,0008
ADD SI,07
UP MOV AL,[SI]
MOV [DI],AL
DEC SI
INC DI
DEC CX
JNZ UP
INT 3

OUTPUT:
Input output
MEMORY Data MEMORY Data
LOCATION LOCATION
IT6411 & CS6412 MICROPROCESSOR & MICROCONTROLLER LAB ----1 ----1
3) INSERT A BYTE IN A GIVEN STRING

AIM: Write an alp for insert a new byte in a given string. -----1
APPARATUS:

1. 8086 microprocessor kit/MASM

2. KEYBOARD

3. PERSONAL COMPUTER

PROGRAM:
A) By using MASM: ASSUME CS:
CODE

CODE SEGMENT

START: MOV SI, 2000


MOV DI, 3000
MOV BX, 5000
MOV CX, 0005
CLD
L1: MOV AL, [SI]
CMP AL, [BX]
JZ L2
MOVSB
JMP L3
L2: MOVSB
MOV BX, 7000
MOV AL, [BX]
MOV [DI], AL
DEC CX
INC DI
REP MOVSB
L3: INT 3
CODE ENDS

END START
IT6411 & CS6412 MICROPROCESSOR & MICROCONTROLLER LAB By
using 8086 kit:

MEMORY OP-CODE LABEL MNEMONIC


LOCATION
4000 MOV SI,2000
MOV DI,3000
MOV BX,5000
MOV CX,0005
CLD
L1 MOV AL,[SI]
CMP AL,[BX]
JZ L2
MOVSB
JMP L3
L2 MOVSB
MOV BX,7000
MOV AL,[BX]
MOV [DI],AL
DEC CX
INC DI
REP
MOVSB
L3 INT 3

Input output
MEMORY Data MEMORY Data
LOCATION LOCATION
IT6411 & CS6412 MICROPROCESSOR & MICROCONTROLLER LAB ----1
4) DELETE A BYTE IN A GIVEN STRING

AIM: To write a alp for delete a byte in a given


string 8086 microprocessor kit/MASM ----1

APPARATUS: KEYBOARD

PERSONAL COMPUTER-----1
1.

2.

3.

PROGRAM:
B) By using MASM: ASSUME CS:
CODE

CODE SEGMENT

START: MOV SI, 2000


MOV DI, 3000
MOV BX, 5000
MOV CX, 0005
CLD
L1: MOV AL, [SI]
CMP AL, [BX]
JZ L2
MOVSB
LOOP L1
JMP L3
L2: INC SI
DEC CX
REP MOVSB
L3: INT 3
CODE ENDS

END START
IT6411 & CS6412 MICROPROCESSOR & MICROCONTROLLER LAB C)
By using 8086 kit:
MEMORY OP-CODE LABEL MNEMONIC
LOCATION
4000 MOV SI,2000
MOV DI,3000
MOV BX,5000
MOV CX,0005
CLD
L1 MOV AL,[SI]
CMP AL,[BX]
JZ L2
MOVSB
LOOP L1
JMP L3
L2 INC SI
DEC CX
REP
MOVSB
L3 INT 3

OUTPUT:
Input output
MEMORY Data MEMORY Data
LOCATION LOCATION

RESULT
IT6411 & CS6412 MICROPROCESSOR & MICROCONTROLLER LAB

Experiment Number:19

Title of the experiment : PASSWORD CHECKING, PRINT RAM SIZE AND SYSTEM DATE

Date of the experiment :

OBJECTIVE(AIM) OF THE EXPERIMENT


Write an ALP for Password checking, Print RAM size and system date.

APPARATUS REQIURED:

1. MASM ----1

2. KEYBOARD ----1

3. PERSONAL COMPUTER -----1

PROGRAM:
;PASSWORD IS MASM1234

DATA SEGMENT

PASSWORD DB 'MASM1234'

LEN EQU ($-PASSWORD)

MSG1 DB 10,13,'ENTER YOUR PASSWORD: $'

MSG2 DB 10,13,'WELCOME TO ELECTRONICS WORLD!!$'

MSG3 DB 10,13,'INCORRECT PASSWORD!$'

NEW DB 10,13,'$'

INST DB 10 DUP(0)

DATA ENDS

CODE SEGMENT ASSUME


CS:CODE,DS:DATA START:

MOV AX,DATA

MOV DS,AX

LEA DX,MSG1

MOV AH,09H

55
IT6411 & CS6412 MICROPROCESSOR & MICROCONTROLLER LAB
INT 21H MOV SI,00 UP1:

MOV AH,08H

INT 21H

CMP AL,0DH

JE DOWN

MOV [INST+SI],AL

MOV DL,'*'

MOV AH,02H

INT 21H

INC SI

JMP UP1 DOWN:

MOV BX,00 MOV CX,LEN


CHECK:

MOV AL,[INST+BX]

MOV DL,[PASSWORD+BX]

CMP AL,DL

JNE FAIL

INC BX

LOOP CHECK

LEA DX,MSG2

MOV AH,09H

INT 21H JMP FINISH


FAIL:

LEA DX,MSG3

MOV AH,009H INT 21H


FINISH: INT 3

CODE ENDS

END START

END
56
IT6411 & CS6412 MICROPROCESSOR & MICROCONTROLLER LAB

;Today.asm Display month/day/year. ; Feb 1st, 2012

;CIS 206 Ken Howard

.MODEL small

.STACK 100h .DATA mess1 DB

10, 13, 'Today is $' ; 10=LF, 13=CR

.CODE

Today PROC

MOV AX, @data

MOV DS, AX

MOV DX, OFFSET mess1 ; Move string to DX

MOV AH, 09h ; 09h call to display string (DX > AH > DOS)

INT 21H ; Send to DOS

; CX year, DH month, DL day

MOV AH, 2AH ; Get the date (appendix D)

INT 21H ; Send to DOS

PUSH CX ; Move year to the stack

MOV CX, 0 ; Clear CX

MOV CL, DL

PUSH CX ; Move day to stack

MOV CL, DH ; Move month > CL

PUSH CX ; Move month to stack

MOV DH, 0 ; Clear DH

; ************************** DISPLAY MONTH ************************ ; Set up for


division

; Dividend will be in DX/AX pair (4 bytes)

; Quotient will be in AX

57
IT6411 & CS6412 MICROPROCESSOR & MICROCONTROLLER LAB
; Remainder will be in DX

MOV DX, 0 ; Clear DX

POP AX ; Remove month from stack into AX

MOV CX, 0 ; Initialize the counter MOV BX,


10 ; Set up the divisor dividem:

DIV BX ; Divide (will be word sized)

PUSH DX ; Save remainder to stack

ADD CX, 1 ; Add one to counter

MOV DX, 0 ; Clear the remainder

CMP AX, 0 ; Compare quotient to zero

JNE dividem ; If quoient is not zero, go to "dividem:" divdispm:

POP DX ; Remove top of stack into DX

ADD DL, 30h ; ADD 30h (2) to DL

MOV AH, 02h ; 02h to display AH (DL)

INT 21H ; Send to DOS

LOOP divdispm ; If more to do, divdispm again

; LOOP subtracts 1 from CX. If non-zero, loop.

MOV DL, '/' ; Character to display goes in DL

MOV AH, 02h ; 02h to display AH (DL)

INT 21H ; Send to DOS

; ************************** DISPLAY DAY ************************

; Set up for division

; Dividend will be in DX/AX pair (4 bytes)

; Quotient will be in AX

; Remainder will be in DX

MOV DX, 0 ; Clear DX

POP AX ; Remove day from stack into AX

58
IT6411 & CS6412 MICROPROCESSOR & MICROCONTROLLER LAB
MOV CX, 0 ; Initialize the counter MOV
BX, 10 ; Set up the divisor divided:

DIV BX ; Divide (will be word sized)

PUSH DX ; Save remainder to stack

ADD CX, 1 ; Add one to counter

MOV DX, 0 ; Clear the remainder

CMP AX, 0 ; Compare quotient to zero

JNE divided ; If quoient is not zero, go to "divided:" divdispd:

POP DX ; Remove top of stack

ADD DL, 30h ; ADD 30h (2) to DL

MOV AH, 02h ; 02h to display AH (DL)

INT 21H ; Send to DOS

LOOP divdispd ; If more to do, divdispd again

; LOOP subtracts 1 from CX. If non-zero, loop.

MOV DL, '/' ; Character to display goes in DL

MOV AH, 02h ; 02h to display AH (DL)

INT 21H ; Send to DOS

; ************************** DISPLAY YEAR ************************

; Set up for division

; Dividend will be in DX/AX pair (4 bytes)

; Quotient will be in AX

; Remainder will be in DX

MOV DX, 0 ; Clear DX

POP AX ; Remove month from stack into AX

MOV CX, 0 ; Initialize the counter MOV BX,


10 ; Set up the divisor dividey:

DIV BX ; Divide (will be word sized)

PUSH DX ; Save remainder to stack


59
IT6411 & CS6412 MICROPROCESSOR & MICROCONTROLLER LAB
ADD CX, 1 ; Add one to counter

MOV DX, 0 ; Clear the remainder

CMP AX, 0 ; Compare quotient to zero

JNE dividey ; If quoient is not zero, go to "dividey:" divdispy:

POP DX ; Remove top of stack into DX

ADD DL, 30h ; ADD 30h (2) to DL

MOV AH, 02h ; 02h to display AH (DL)

INT 21H ; Send to DOS

LOOP divdispy ; If more to do, divdisp again

; LOOP subtracts 1 from CX. If non-zero, loop.

MOV al, 0 ; Use 0 as return code

MOV AH, 4ch ; Send return code to AH INT 21H


; Send return code to DOS to exit.

Today ENDP ; End procedure

END Today ; End code. Start using "Today" procedure.

MVI A, 80H: Initialize 8255, port A and port B

OUT 83H (CR): in output mode

START: MVI A, 09H

OUT 80H (PA): Send data on PA to glow R1 and R2

MVI A, 24H

OUT 81H (PB): Send data on PB to glow G3 and G4

MVI C, 28H: Load multiplier count (40ıο) for delay

CALL DELAY: Call delay subroutine

MVI A, 12H

OUT (81H) PA: Send data on Port A to glow Y1 and Y2 OUT


(81H) PB: Send data on port B to glow Y3 and Y4

MVI C, 0AH: Load multiplier count (10ıο) for delay

CALL: DELAY: Call delay subroutine


60
IT6411 & CS6412 MICROPROCESSOR & MICROCONTROLLER LAB
MVI A, 24H

OUT (80H) PA: Send data on port A to glow G1 and G2

MVI A, 09H

OUT (81H) PB: Send data on port B to glow R3 and R4

MVI C, 28H: Load multiplier count (40ıο) for delay

CALL DELAY: Call delay subroutine

MVI A, 12H

OUT PA: Send data on port A to glow Y1 and Y2 OUT PB: Send
data on port B to glow Y3 and Y4 MVI C, 0AH: Load multiplier
count (10ıο) for delay

CALL DELAY: Call delay subroutine

JMP START

Delay Subroutine:

DELAY: LXI D, Count: Load count to give 0.5 sec delay

BACK: DCX D: Decrement counter

MOV A, D

ORA E: Check whether count is 0

JNZ BACK: If not zero, repeat

DCR C: Check if multiplier zero, otherwise repeat

JNZ DELAY

RET: Return to main program

Ram size:

ORG 0000H

CLR PSW3

CLR PSW4

CPL A

ADD A, #01H

MOV A,R3
61
IT6411 & CS6412 MICROPROCESSOR & MICROCONTROLLER LAB
AGAIN: SJMP AGAIN

62
IT6411 & CS6412 MICROPROCESSOR & MICROCONTROLLER LAB
RESULT:

Experiment Number:20

Title of the experiment : COUNTERS AND TIME DELAY

Date of the experiment :

OBJECTIVE(AIM) OF THE EXPERIMENT


Write an ALP for Counters and Time Delay.

APPARATUS REQIURED:

1. MASM ----1

2. KEYBOARD ----1

3. PERSONAL COMPUTER -----1

PROGRAM:

.MODEL SMALL
.DATA

MSGIN DB 'Enter delay duration (0-50): $'


MSG1 DB 'This is Microprocessor!$'
DELAYTIME DW 0000H

.CODE

MOV DX,@DATA
MOV DS,DX
LEA DX,MSGIN
MOV AH,09H
INT 21H

IN1:
MOV AH,01H
INT 21H
CMP AL,0DH ; JE NXT
63
IT6411 & CS6412 MICROPROCESSOR & MICROCONTROLLER LAB
SUB AL,30H
MOV DL,AL
MOV AX,BX
MOV CL,0AH
MUL CL
MOV BX,AX
AND DX,00FFH
ADD BX,DX
MOV DELAYTIME,BX
LOOP IN1

NXT: MOV CX,DELAYTIME

MOV DL,10
MOV AH,02H
INT 21H

LEA SI,MSG1

LP: PUSH DX MOV DL,[SI]


CMP DL,'$'
JE NXT2
MOV AH,02H
INT 21H
ADD SI,1
POP DX
MOV DI,DELAYTIME
MOV AH, 0
INT 1Ah
MOV BX, DX

Delay:
MOV AH, 0
INT 1Ah
SUB DX, BX
CMP DI, DX
JA Delay

LOOP LP

NXT2: MOV AH,4CH


INT 21H

END

64
IT6411 & CS6412 MICROPROCESSOR & MICROCONTROLLER LAB

RESULT:

Experiment Number:21

Title of the experiment :8–BIT ADDITION USING 8051

Date of the experiment :

OBJECTIVE(AIM) OF THE EXPERIMENT

To write an assembly language program to add two 8- bit numbers using 8051.

APPARATUS REQUIRED

Sl.No. Facilities Required Quantity


1 8051 MicroprocessorKit 1
2 Keyboard 1

PROGRAM:

ADDRESS OPCODE LABEL MNEMONICS COMMENTS


4100 7405 MOV A,#Data1 Move data1 to Areg.
4102 2404 ADD A,#Data2 Add data2 and Areg content
4104 904500 MOV DPTR,#4500 Move the data in address to data pointer
4107 F0 MOVX @DPTR,A Move Areg to data pointer
4108 80FE HERE SJMP HERE Jump on HERE

OUTPUT:

INPUT OUTPUT

65
IT6411 & CS6412 MICROPROCESSOR & MICROCONTROLLER LAB
ADDRESS DATA ADDRESS DATA
4101
4104
4500

RESULT:

66
IT6411 & CS6412 MICROPROCESSOR & MICROCONTROLLER LAB

Experiment Number:22
Title of the experiment :8–BIT SUBTRACTION USING 8051

Date of the experiment :

OBJECTIVE(AIM) OF THE EXPERIMENT

To write an assembly language program to subtract two8- bit numbers using 8051.

APPARATUS REQUIRED

Sl.No. FacilitiesRequired Quantity


1 8051 Microprocessor Kit 1
2 Keyboard 1

PROGRAM:

ADDRESS OPCODE LABEL MNEMONICS COMMENTS


4100 7405 MOV A,#Data1 Move data1 to Areg.
4102 9403 SUBB A,#Data2 Subtract data2 and Areg content
4104 904500 MOV DPTR,#4500 Move the data in address to data pointer
4107 F0 MOVX @DPTR,A Move Areg to data pointer
4108 80FE HERE SJMP HERE Jump on HERE

OUTPUT:

INPUT OUTPUT

ADDRESS DATA ADDRESS DATA


4101
4104
4500

RESULT:

Experiment Number:23

Title of the experiment :8–BIT MULTIPLICATION USING8051

Date of the experiment :

OBJECTIVE(AIM) OF THE EXPERIMENT

67
IT6411 & CS6412 MICROPROCESSOR & MICROCONTROLLER LAB

To write an assembly language program to multiplication two8-bit numbers using 8051.

APPARATUS REQUIRED

Sl.No. FacilitiesRequired Quantity


1 8051 Microprocessor Kit 1
2 Keyboard 1

PROGRAM:

ADDRESS OPCODE LABEL MNEMONICS COMMENTS


4100 740A MOV A,#0A Data is moved to Areg
4102 75F088 MOV B,#88 Data is moved to Berg
4105 A4 MUL A,B Multiply data in A,B
4106 904500 MOV DPTR,#4000 Initialize memory pointer
4109 F0 MOVX @DPTR,A Move Areg content to immediate DPTR
410A A3 INC DPTR Increment DPTR
410B E5F0 MOV A,B Move Breg contents to A reg
410D F0 MOVX @DPTR,A Move Areg content to memory pointer
410E 80FE HERE SJMP HERE Loop is terminated

OUTPUT:

INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
4101 4500
4104 4501
RESULT:

Experiment Number:24

Title of the experiment :8–BIT DIVISION USING8051

Date of the experiment :

OBJECTIVE(AIM) OF THE EXPERIMENT

To write an assembly language program to division two8-bit numbers using 8051.

APPARATUS REQUIRED

Sl.No. Facilities Required Quantity


1 8051 Microprocessor Kit 1

68
IT6411 & CS6412 MICROPROCESSOR & MICROCONTROLLER LAB

2 Keyboard 1

PROGRAM:

ADDRESS OPCODE LABEL MNEMONICS COMMENTS


4100 7408 MOV A,#08 Data is moved to Areg
4102 75 MOV B,#04 Data is moved to Berg
4105 84 DIV A,B Divide data in A&B
4106 904500 MOV DPTR,#4000 Initialize memory pointer
4109 F0 MOV X@DPTR,A Move Areg content to immediate DPTR

410A A3 INC DPTR Increment DPTR


410B E5F0 MOV A,B Move Breg contents to Areg
410D F0 MOVX @DPTR,A Move Areg content to memory pointer
410E 80FE HERE SJMP HERE Loop is terminated

OUTPUT:

INPUT OUTPUT

ADDRESS DATA ADDRESS DATA


4101 4500
4104 4501

69
IT6411 & CS6412 MICROPROCESSOR & MICROCONTROLLER LAB

Experiment Number:25

Title of the experiment :BCD TO ASCII USING8051

Date of the experiment :

OBJECTIVE(AIM) OF THE EXPERIMENT

To write an assembly language program to convert BCD to ASCII using 8051.

APPARATUS REQUIRED

Sl.No. Facilities Required Quantity


1 8051 Microprocessor Kit 1
2 Keyboard 1

PROGRAM

ADDRESS OPCODE LABEL MNEMONICS COMMENTS


8000 MOV R0,#23
LCALL 9000
LCALL 0003

9000 MOV A,R0


ANL A,#0F
ADD A,#30
MOV R1,A
MOV A,R0
ANL A,#F0
SWAP A
ADD A,#30
MOV R2,A
RET

2
IT6411 & CS6412 MICROPROCESSOR & MICROCONTROLLER LAB

Experiment Number:26

Title of the experiment :TRAFFIC LIGHT CONTROL USING 8086

Date of the experiment :

OBJECTIVE(AIM) OF THE EXPERIMENT

To write an assembly language program for traffic light control using 8086.

APPARATUS REQUIRED

Sl.No. Facilities Required Quantity


1 8086 Microprocessor Kit 1
2 Keyboard 1
3 Traffic light interface 1

PROGRAM

ADDRESS OPCODE LABEL MNEMONICS COMMENTS


9500 BA 26 FF MOV DX,FF26
9503 B0 81 MOV AL,81H
9505 EE LOOP 1 OUT DX,AL
9506 BA 20 FF MOV DX,FF20
9509 B0 CC MOV AL,CC
950B EE OUT DX,AL
950C BA 22 FF MOV DX,FF22
950F B0 11 MOV AL,11
9511 EE OUT DX,AL
9512 E8 2F 00 CALL DELAY1
9515 BA 20 FF MOV DX,FF20
9518 B0 AA MOV AL,AA
951A EE OUT DX,AL
951B BA 22 FF MOV DX,FF22

3
IT6411 & CS6412 MICROPROCESSOR & MICROCONTROLLER LAB
951E B0 AA MOV AL,AA
9520 EE OUT DX,AL
9521 E8 31 00 CALL DELAY2
9524 BA 20 FF MOV DX,FF20
9527 B0 11 MOV AL,11
9529 EE OUT DX,AL
952A BA 22 FF MOV DX,FF22
952D B0 CC MOC AL,CL
952F EE OUT DX,AL
9530 E8 2F 00 CALL DELAY1
9533 BA 20 FF MOV DX,FF20
9536 B0 AA MOV AL,AA
9538 EE OUT DX,AL
9539 BA 22 FF MOV DX,FF22
953C B0 AA MOV AL,AA
953E EE OUT DX,AL
953F E8 31 00 CALL DELAY2
9542 EB C1 JMP LOOP1
9544 BB 0F FF DELAY 1 MOV BX,0FFF
9547 B0 FF LOOP2 MOV AL,FF
9549 90 LOOP3 NOP
954A 90 NOP
954B 90 NOP
954C 90 NOP
954D FE C8 DEC AL
954F 75 F8 JNZ LOOP3
9551 4B DEC BX
9552 75 F3 JNZ LOOP2
9554 C3 RET
9555 BB 10 00 DELAY2 MOV BX,1000
9558 B0 FF LOOP4 MOV AL,FF
955A 90 LOOP5 NOP
955B 90 NOP
955C 90 NOP
955D 90 NOP
955E FE C8 DEC AL
9560 75 F8 JNZ LOOP5
9562 4B DEC BX
9563 75 F3 JNZ LOOP4
8015 CC INT 3
4
IT6411 & CS6412 MICROPROCESSOR & MICROCONTROLLER LAB

Experiment Number:27

Title of the experiment :STEPPER MOTOR CONTROL USING 8086

Date of the experiment :

OBJECTIVE(AIM) OF THE EXPERIMENT

To write an assembly language program for stepper motor control using 8086.

APPARATUS REQUIRED

Sl.No. Facilities Required Quantity


1 8086 Microprocessor Kit 1
2 Keyboard 1
3 Stepper motor interface 1

PROCEDURE

1. Connect the 5V supply to the trainer kit and stepper motor chord.
2. Connect the +12V supply to the power bit wire(yellow color ) in the chord.
3. Connect the corresponding grounds.
4. Connect the 26-pin FRC from the kit to the chord.
5. Switch on the power supply.
6. Assemble the program and execute it.
7. The stepper motor will start rotating either in clockwise or anticlockwise direction based
in the order of the coil excitation.
8. Switch off the power supply and remove all the connections.

5
IT6411 & CS6412 MICROPROCESSOR & MICROCONTROLLER LAB
PROGRAM

ADDRESS OPCODE LABEL MNEMONICS COMMENTS


1000 BA 26 FF MOV DX,FF26
1003 B0 80 MOV AL,80
1005 EE OUT DX,AL
1006 BA 20 FF LOOP 1 MOV DX,FF20
1009 B0 A0 MOV AL,A0
100B EE OUT DX,AL
100C E8 F1 00 CALL 1100
100F B0 E0 MOV AL,E0
1011 EE OUT DX,AL
1012 E8 EB 00 CALL 1100
1015 B0 C0 MOV AL,C0
1017 EE OUT DX,AL
1018 E8 E5 00 CALL 1100
101B B0 80 MOV AL,80
101D EE OUT DX,AL
101E E8 EB 00 CALL 1100
1021 EB E3 JMP 1006(LOOP 1)
DELAY
1100 BB 10 00 MOV BX,0010
1103 B0 FF LOOP 2 MOV AL,FF
1105 90 LOOP 3 NOP
1106 90 NOP
1107 90 NOP
1108 90 NOP
1109 FE C8 DEC AL
110B 75 F8 JNZ 1105(LOOP 3)
110D 4B DEC BX
110E 75 F3 JNZ 1103(LOOP 2)
1110 C3 RET

6
IT6411 & CS6412 MICROPROCESSOR & MICROCONTROLLER LAB

RESULT

Experiment Number:28

Title of the experiment :ADC AND DAC INTERFACE USING 8086

Date of the experiment :

OBJECTIVE(AIM) OF THE EXPERIMENT

To write an assembly language program for ADC and DAC interface using 8086.

APPARATUS REQUIRED

Sl.No. Facilities Required Quantity


1 8086 Microprocessor Kit 1
2 Keyboard 1
3 ADC AND DAC interface 1

1).ADC INTERFACE:

PROCEDURE

1. Connect the 9 pin D type connector from the ADC module to the kit.
2. Connect the 26-pin connector from the ADC module to kit.
3. Connect the keyboard to the kit.
4. Switch on the power supply.
7
IT6411 & CS6412 MICROPROCESSOR & MICROCONTROLLER LAB
5. Assemble your program.
6. Vary the potentiometer in the ADC card(0 to 5V).
7. Execute it and view the output count in the accumulator, which will be displayed in the
LCD display.
8. Vary the pot , execute the program and measure the count value in the accumulator.
9. Take number of readings and if required draw the graph, ADC input volts Vs counts to
check the linearity.
10. After enough of reading have been taken reduce the pot to its minimum value.
11. Switch off the power supply and remove all the connections.

PROGRAM

ADDRESS OPCODE LABEL MNEMONICS COMMENTS


1000 BA 26 FF MOV DX,FF26
1003 B0 90 MOV AL,90
1005 EE OUT DX,AL
1006 BA 24 FF MOV DX,FF24
1009 B0 FF MOV AL,FF
100B EE OUT DX,AL
100C B0 00 MOV AL,00
100E EE OUT DX,AL
100F B0 FF MOV AL,FF
1011 EE OUT DX,AL
1012 E8 EB 00 CALL 1100
1015 BA 20 FF MOV DX,FF20
1018 EC IN AL,DX
1019 CC INT 3
DELAY
1100 B9 FF FF MOV CX,FFFF
1103 90 LOOP 1 NOP
1104 90 NOP
1105 49 DEC CX
1106 75 FB JNZ 1103(LOOP 1)
1108 C3 RET

2). DAC INTERFACE

PROCEDURE

1. Connect the 9 pin D type connector from the DAC module to the kit.
2. Connect the 26-pin connector from the DAC module to kit.
3. Connect the keyboard to the kit.
8
IT6411 & CS6412 MICROPROCESSOR & MICROCONTROLLER LAB
4. Switch on the power supply.
5. Assemble your program.
6. Execute it and measure the output voltage/ waveform at the front panel of the DAC
module.
7. Vary the digital count, execute the program and measure the output analog voltage.
8. Take number of readings and if required draw the graph, DAC input count Vs output
voltage to check the linearity.
9. Switch off the power supply and remove all the connection.

PROGRAM
ADDRESS OPCODE LABEL MNEMONICS COMMENTS
2000 BA 26 FF MOV DX,FF26
2003 B0 80 MOV AL,80
2005 EE OUT DX,AL
2006 BA 22 FF LOOP 1 MOV DX,FF22
2009 B0 FF MOV AL,FF
200B EE OUT DX,AL
200C CC INT 3

RESULT

Experiment Number:29

Title of the experiment :KEYBOARD AND DISPLAY INTERFACE USING 8086

Date of the experiment :

OBJECTIVE(AIM) OF THE EXPERIMENT

To write an assembly language program for keyboard and display interface using 8086.

APPARATUS REQUIRED

Sl.No. Facilities Required Quantity


1 8086 Microprocessor Kit 1
2 Keyboard 1
9
IT6411 & CS6412 MICROPROCESSOR & MICROCONTROLLER LAB
3 Keyboard and display interface 1

PROGRAM 1). KEYBOARD INTERFACE

ADDRESS OPCODE LABEL MNEMONICS COMMENTS


1000 B0 12 MOV AL,12
1002 BA 52 FF MOV DX,FF52
1005 EE OUT DX,AL
1006 B0 3E MOV AL,3E
1008 EE OUT DX,AL
1009 B0 A0 MOV AL,A0
100B EE OUT DX,AL
100C EC IN AL,DX
100D 24 07 AND AL,07
100F 74 FB JZ 100C
1011 BA 50 FF MOV DX,FF50
1014 EC IN AL,DX
1015 24 3F AND AL,3F
1019 CC INT 3

2). DISPLAY INTERFACE

ADDRESS OPCODE LABEL MNEMONICS COMMENTS


8000 B0 12 MOV AL,12
8002 BA 52 FF MOV DX,FF52
8005 EE OUT DX,AL
8006 B0 3E MOV AL,3E
8008 EE OUT DX,AL
8009 B0 A0 MOV AL,A0
800B EE OUT DX,AL
800C B4 08 MOV AH,08
800E BA 50 FF MOV DX,FF50

10
IT6411 & CS6412 MICROPROCESSOR & MICROCONTROLLER LAB
8011 B0 00 MOV AL,00
8013 EE LOOP 1 OUT DX,AL
8014 FE CC DEC AH
8016 75 FB JNZ 8013(LOOP 1)
8018 BA 50 FF MOV DX,FF50
801B B1 06 MOV CL,06
801D BB 00 20 MOV BX,2000
8020 8A 07 LOOP 2 MOV AL,[BX]
8022 EE OUT DX,AL
8023 43 INC BX
8024 FE C9 DEC CL
8026 75 F8 JNZ 8020(LOOP 2)
8028 CC INT 3

RESULT

Experiment Number:30

Title of the experiment :SERIAL COMMUNICATION INTERFACE USING 8086 Date


of the experiment :

OBJECTIVE(AIM) OF THE EXPERIMENT

To write an assembly language program for Serial Communication interface using 8086.

11
IT6411 & CS6412 MICROPROCESSOR & MICROCONTROLLER LAB
APPARATUS REQUIRED

Sl.No. Facilities Required Quantity


1 8086 Microprocessor Kit 1
2 8251 Interface Kit 1

PROGRAM
MEMORY OPCODE PNEMONICS

1100 BE 00 15 MOV SI,1500H

1103 B0 36 MOV AL,36H

1105 BA 06 FF MOV DX,FF06

1108 EE OUT DX,AL

1109 B0 40 MOV AL,40H

110B BA 04 FF MOV DX,FF04

110E EE OUT DX,AL

110F B0 01 MOV AL,01H

1111 BA 04 FF MOV DX,FF04

1114 EE OUT DX,AL

1115 B1 05 RELOAD: MOV CL,05H

1117 BA 12 FF CHECK: MOV DX,FF12

111A EC IN AL,DX

111B 24 02 AND AL,02H

111D 74 F8 JZ CHECK

111F BA 10 FF MOV DX,FF10

1122 EC IN AL,DX

1123 88 04 MOV [SI],AL

1125 46 INC SI

1126 3C 3F CMP AL,3FH

1128 75 EB JNZ RELOAD

12
IT6411 & CS6412 MICROPROCESSOR & MICROCONTROLLER LAB
112A FE C9 DEC CL

112C 75 E9 JNZ CHECK

112E CD 02 INT 3

1130 CD 02 INT 3

ADDRESS DATA

1500 48H,45H,4CH,4CH

1504 4FH,2DH,38H,30H

1508 38H,35H,0AH,0DH

150C END

RESULT

Experiment Number:31

13
IT6411 & CS6412 MICROPROCESSOR & MICROCONTROLLER LAB
Title of the experiment :DIGITAL CLOCK USING 8086

Date of the experiment :

OBJECTIVE(AIM) OF THE EXPERIMENT


To write an ALP program for displaying the system clock.
APPARATUS:
1. MASM
2. PC

PROGRAM:
ASSUME CS: CODE

CODE SEGMENT

EXTERN GET_TIME: NEAR

.MODEL SMALL

.STACK 100H

.DATA

TIME_BUF DB ‟00:00:00$‟
CODE
MAIN PROC
MOV AX,@DATA MOV DS, AX
LEA BX, TIME_BUF
CALL GET_TIME
LEA DX, TIME_BUF
MOV AH, 09H
INT 21H
MOV AH, 4CH
INT 21H
MAIN ENDP

END MAIN

RESULT

VIVA VOCE QUESTIONS

14
IT6411 & CS6412 MICROPROCESSOR & MICROCONTROLLER LAB
1. Mention the general purpose registers in 8085 microprocessor.
2. What is the function of accumulator?
3. What are the flag registers available in 8085?
4. What is buffer?
5. Mention the groups of 8085 pin signals.
6. Explain the function of program counter.
7. What is the function of SP?
8. What is memory?
9. What are the types of memory?
10. What is memory word?
11. What are the programming registers in 8085?
12. Mention the types of 8085 instruction set.
13. Write any two data transfer instructions of 8085.
14. What is memory address?
15. What is Opcode?
16. What is Operand?
17. What is stack?
18. How many memory locations can be addressed by a microprocessor with 14 address lines?
19. How many address lines are necessary to address two megabytes (2048K) of memory?
20. How many address lines are necessary to address two megabytes(2048K) of memory?
21. What is the purpose of branch instructions in 8085 microprocessor?
22. What is the use of programming technique
23. How many memory locations are available in 8086 microprocessor?
24. What are the flags available in 8086 microprocessor?
25. What are the general purpose registers in 8086?
26. What are the functional units in 8086?
27. What is the purpose of BIU?
28. What is the purpose of EU?
29. What is the purpose of segment register?
30. What are the segment registers in 8086?
31. What is the function of IP?
32. What is the function of control unit?
33. What is the use of base pointer register?
34. Mention the index registers of 8086.
35. What is effective address?
36. What are the assembly language program development steps?
37. What are the instructions types of 8086 mp?
38. Write any two data transfer instructions?
39. Write any two arithmetic instructions.
40. Write any two bit manipulation instructions.
41. Write any two string manipulation instructions.
42. Define CALL and RET.
43. Write any two processor control instructions.
44. Mention any four initialization list in the 8086 program.
45. What are the assembly language program development tools?
46. What is an assembler directive?
47. Define SEGEMNT and ENDS.
48. Define EQU and DB directive.
49. What is editor?
50. Define assembler.
51. Define Linker.
52. What is locator?
53. What is debugger?

15
IT6411 & CS6412 MICROPROCESSOR & MICROCONTROLLER LAB
54. What is emulator?
55. What are the advantages of segment registers?
56. Define the trap flag.
57. What is effective address?
58. What is physical address?
59. What is operand?
60. What are the types of addressing modes?
61. Define register addressing mode.
62. What is the purpose of register addressing mode?
63. What is immediate addressing mode?
64. Define direct addressing mode.
65. Define register indirect addressing mode.
66. What is index addressing mode?
67. What is base index addressing mode?
68. What is the use of CMP instruction?
69. Mention the two operation modes of 8086 processor.
70. What is minimum mode?
71. What is maximum mode?
72. What is machine cycle?
73. What is instructions cycle?
74. What are the minimum mode signals?
75. What are the maximum mode signals?
76. What is the purpose of INTR pin?
77. What is the function of BHE/S7 pin?
78. How minimum mode or maximum mode is is selected?
79. What are the two modes of 8086 and how do you configure 8086 to work in these modes?
80. How do you classify the programmed I/O data transfer scheme?
81. Give the function of the following pins-Ready, ALE.
82. What is a machine cycle initiated? How many T states does each machine cycle contain in 8086?
83. What do you understand by handshaking?
84. Explain real mode and protected mode of operations?
85. Which signals are used by 8086 microprocessor to specify the current segment portion of the
address referred?
86. Can the 8086 microprocessor operate on more than one instruction at a time? If so, explain how it
is done.
87. Why word type of data has to be stored starting from an even address in 8086?
88. Mention the function of RQ/GT.
89. What are the display modes supported by the 8279 chip?
90. Name any two coprocessors and their use.
91. Give the format of program clock word of 8279 and mention its purpose.
92. Mention any two coprocessors and their use.
93. What is 2 key lockout and n key rollover?
94. Name the two types of CRT display systems.
95. What do you mean by leading edge and trailing edge problems in hexadecimal keyboards?
96. State any two main functions of a CRT controller.

16

Vous aimerez peut-être aussi