0% found this document useful (0 votes)
203 views137 pages

MANUAL

This document contains the laboratory course manual for the Microprocessor and Microcontroller Laboratory course. It includes the syllabus, list of experiments, execution procedures for 8086 and 8051 microprocessors, and an introduction to MASM/TASM assembler software. The syllabus outlines the objectives of introducing assembly language concepts and interfacing peripherals. It lists 15 experiments for 8086 and 8051 covering basic arithmetic, logical operations, interfacing stepper motors, and serial/parallel communication.

Uploaded by

Hdhdh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
203 views137 pages

MANUAL

This document contains the laboratory course manual for the Microprocessor and Microcontroller Laboratory course. It includes the syllabus, list of experiments, execution procedures for 8086 and 8051 microprocessors, and an introduction to MASM/TASM assembler software. The syllabus outlines the objectives of introducing assembly language concepts and interfacing peripherals. It lists 15 experiments for 8086 and 8051 covering basic arithmetic, logical operations, interfacing stepper motors, and serial/parallel communication.

Uploaded by

Hdhdh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 137

RAJALAKSHMI INSTITUTE OF TECHNOLOGY

KUTHAMBAKKAM, CHENNAI 600124

DEPARTMENT OF
ELECTRONICS AND COMMUNICATION ENGINEERING

LABORATORY COURSE MANUAL

Course Code : EC8681


Course Name : Microprocessor and Microcontroller Laboratory
Year/Semester : III/V - CSE

Prepared By: Mr.B.Manimaran AP/ECE

SYLLABUS
CS6412/IT6411 MICROPROCESSOR AND MICROCONTROLLER LABORATORY

LT P C
0 0 3 2
OBJECTIVES:

The student should be made to:


 Introduce ALP concepts and features
 Write ALP for arithmetic and logical operations in 8086 and 8051
 Differentiate Serial and Parallel Interface
 Interface different I/Os with Microprocessors
 Be familiar with MASM

LIST OF EXPERIMENTS:

8086 Programs using kits and MASM

1. Basic arithmetic and Logical operations


2. Move a data block without overlap
3. Code conversion, decimal arithmetic and Matrix operations.
4. Floating point operations, string manipulations, sorting and searching
5. Password checking, Print RAM size and system date
6. Counters and Time Delay

Peripherals and Interfacing Experiments

7. Traffic light control


8. Stepper motor control
9. Digital clock
10. Key board and Display
11. Printer status
12. Serial interface and Parallel interface
13. A/D and D/A interface and Waveform Generation

8051 Experiments using kits and MASM

14. Basic arithmetic and Logical operations


15. Square and Cube program, Find 2’s complement of a number
16. Unpacked BCD to ASCII

TOTAL: 45 PERIODS

CYCLE 1:
8086 MICROPROCESSOR

1. 16 BIT ADDITION AND SUBTRACTION.


2. 16 BIT MULTIPLICATION AND DIVISION
3. ASCENDING AND DESCENDING ORDER.
4. LARGEST AND SMALLEST NUMBER.
5. COPY OPERATION.
6. STRING MANIPULATION.
7. CODE CONVERSION.
8. LOGICAL OPERATIONS
9. MOVE A DATA BLOCK WITHOUT OVERLAP
10. 16 BIT DECIMAL OPERATIONS
11. PASSWORD CHECKING, PRINT RAM SIZE AND SYSTEM DATE
12. COUNTERS AND TIME DELAY
13. FIND AND REPLACE OF DATA.
14. ADDITION OF 3X3 MATRIX

CYCLE 2:

8051 MICRO CONTROLLER

1. 8-BIT AND 16-BIT ADDITION.


2. 8-BIT AND 16-BIT SUBTRACTION.
3. 8-BIT MULTIPLICATION.
4. 8-BIT DIVISION.
5. FIND A TWO’S COMPLEMENT OF A NUMBER.
6. FIND A SQUARE OF A NUMBER.
7. FIND A CUBE OF A NUMBER.

CYCLE 3:

INTERFACING (8086&8051)

1. STEPPER MOTOR.
2. PARALLEL COMMUNICATION(8255)
3. DIGITAL TO ANALOG CONVERTOR (DAC).
4. COUNTER DESIGN.
5. KEYBOARD AND DISPLAY.
6. TRAFFIC LIGHT CONTROLLER.
7. DIGITAL CLOCK
8. SERIAL AND PARALLEL INTERFACE

MASM EXPERIMENTS

1.ARITHMETIC AND LOGICAL OPERATIONS


2.ASCENDING AND DESCENDING ORDER OF ‘N’ NUMBERS
3.LARGEST AND SMALLEST OF ‘N’ NUMBER
4.PALINDROME CHECKING
5.PRINTER STATUS
6.SYSTEM TIME
7.TIME DELAY
8.PASSWORD CHECKING
EXECUTION PROCEDURE FOR 8086 (for registers)
i) Writing a alp program into processor:
Switch On Power Supply
Press A 2times
SG 0 press enter
DA starting address
Press enter
N
st
Then display shows @ here you have to write 1 mnemonic
Press enter
N (display displays address opcode mnemonic)
N
Then display shows @ here you have to write 2nd mnemonic
Press enter
N
N
-
-
Then display shows @ up to last mnemonic
Press enter
N
N
! Press enter EX
press enter
ii) Execution of program (for registers):
G enter starting address
Press enter
iii) Verify the CONCLUSION (for registers):
press R Press E.

EXECUTION PROCEDURE FOR 8086 (for memory locations)


i) Writing a alp program into processor:
Switch On Power Supply
Press A
A
SG 0
Press enter
DA starting address
Press enter
N
st
Then display shows @ here you have to write 1 mnemonic
Press enter
N(display displays address opcode mnemonic)
N
Then display shows @ here you have to write 2nd mnemonic
Press enter
N
N
-
-
-
-
Then display shows @ up to last mnemonic
Press enter
N
N
! Press enter EX
press enter E (exam
byte)
st
Here you have to type SI address, give 1 data, 2nd data, -----, nth data,
Press enter

ii) Execution of program (for memory locations):


G enter starting address
Press enter
iii) Verify the CONCLUSION (for memory locations):
E
Then give DI address press, then display shows the
st
CONCLUSION of 1 8 bit data
nd
For 2 8 bit data again press, -------, nth data

Introduction to MASM /TASM


MASM: (Microsoft assembler)
To Create Source File: An editor is a program which allows you to create a file containing the
assembly language statements for your program. This file is called a source file.
Command to create a source file

C:\MASM\BIN> Edit filename. asm


The next step is to process the source file with an assembler. When you run the assembler, it reads the
source file of your program. On the first pass through the source program, the assembler determines
the displacement of named data items, the offset labels, etc. and puts this information in a symbol
table. On the second pass through the source program the assembler produces the binary code for each
instruction and inserts the offsets, etc. that it calculated during first pass.

C:\MASM\BIN > Masm filename. asm X, Z


With this command assembler generates three files.
1. The first file (X) called the object file, is given the extension .OBJ
The object file contains the binary codes for the instructions and information about the addresses of
the instructions.
2. The third file (Z) generated by this assembler is called the cross-reference file and is given the
extension .CRF. The cross-reference file lists all labels and pertinent information required for cross –
referencing.

NOTE : The Assembler only finds syntax errors : It will not tell you whether program does what it is
supposed to do. To determine whether your program works, you have to run the program and test it.
Next step is to process the object file with linker.

C:\MASM\BIN>LINK filename. obj


Run File [Filename1.exe] : “filename1.exe”
List file [nul.map]: NUL
Libraries [.lib]: library name
Definitions File [nul.def]:
Creation of Library: Refer Modular Programming Section
A Linker is a program used to join several object files into one layer object file.
8086
MICROPROCESSOR

Basic Arithmetic and Logical operation


EX NO:

DATE:

OBJECTIVE:
To write an Assembly Language Program (ALP) to perform basic arithmetic and
logical operation using 8086 microprocessor.

COMPONENTS REQUIRED:

S.NO COMPONENTS SPECIFICATION QUANTITY


1. Microprocessor kit 8086 kit 1
2. Power Supply +5 V dc 1
3. Key board - 1
4. MASM Software - 1

16 BIT ARITHMETIC OPERATIONS

1.A 16 BIT ADDITION

ALGORITHM:

STEP 1: Start the program.

STEP 2: Get the input data’s and stored it in registers.

STEP 3: Addition operation is performed using sequence of instruction.

STEP 4: Store the CONCLUSIONs in separate memory locations

STEP 5: Stop the program

FLOW CHART:

I6-BIT ADDITION
PROGRAM:
16-BIT ADDITION
ADDRES LABE MNEMONI
S L CS
MOV
1000 BX,2000
MOV AX,
1003 [BX]
1005 INC BX
1006 INC BX
MOV CX,
1007 [BX]
1009 MOV DL,00
100B ADD AX,CX
100D JNB XXX
100F INC DL
1011 XXX INC BX
1012 INCBX
MOV
1013 [BX],AX
1015 INC BX
1016 INC BX
MOV
1017 [BX],DL
1019 HLT

SAMPLE INPUT AND OUTPUT


16-BIT ADDITION

WITHOUT CARRY
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA

1200 1300

1201 1301

1202 1302

1203

WITH CARRY

INPUT OUTPUT
ADDRESS DATA ADDRESS DATA

1200 1300

1201 1301

1202 1302

1203
1.B 16 BIT SUBTRACTION

ALGORITHM:

STEP 1: Start the program.

STEP 2: Get the input data’s and stored it in registers.

STEP 3: Subtraction operation is performed using sequence of instruction.

STEP 4: Store the CONCLUSIONs in separate memory locations

STEP 5: Stop the program

FLOW CHART:
I6-BIT SUBTRACTION
PROGRAM:16-BIT SUBTRACTION

ADDRESS LABEL MNEMONICS


1000 MOV BX,2000
1003 MOV AX,[BX]
1005 INC BX
1006 INC BX
1007 MOV CX,[BX]
1009 MOV DL,00
100B SUB AX,CX
100D JNB XXX
100F INC DL
1011 XXX INC BX
1012 INCBX
1013 MOV [BX],AX
1015 INC BX
1016 INC BX
1017 MOV [BX],DL
1019 HLT

SAMPLE INPUT AND OUTPUT


16-BIT SUBTRACTION
WITHOUT BORROW
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA

1200 1300

1201 1301

1202 1302

1203

WITH BORROW
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA

1200 1300

1201 1301

1202 1302

1203

1.C 16 BIT MULTIPLICATION


ALGORITHM:
STEP 1: Start the program.

STEP 2: Get the input data’s and stored it in registers.

STEP 3: Multiplication operation is performed using sequence of instruction.

STEP 4: Store the CONCLUSIONs in separate memory locations.

STEP 5: Stop the program

FLOW CHART:

16-BIT MULTIPLICATION
PROGARM:
ADDRESS LABEL MNEMONICS
1000 MOV BX,2000
1003 MOV AX,[BX]
1005 INC BX
1006 INC BX
1007 MOV CX,[BX]
1009 MOV DX,00
100B MUL CX
100D INC BX
100E INC BX
100F MOV [BX],AX
1011 INC BX
1012 INC BX
1013 MOV [BX],DX
1015 HLT
SAMPLE INPUT AND OUTPUT
16-BIT MULTIPLICATION
WITHOUT CARRY

INPUT OUTPUT
ADDRESS DATA ADDRESS DATA

1200 1300

1201 1301

1202 1302

1203 1303

1.D 16 BIT DIVISION


ALGORITHM:

STEP 1: Start the program.


STEP 2: Get the input data’s and stored it in registers.

STEP 3: Division operation is performed using sequence of instruction.

STEP 4: Store the CONCLUSIONs in separate memory locations.

STEP 5: Stop the program

FLOW CHART:
16-BIT DIVISION
PROGRAM:
ADDRESS LABEL MNEMONICS
1000 MOV BX,2000
1003 MOV AX,[BX]
1005 INC BX
1006 INC BX
1007 MOV CX,[BX]
1009 MOV DX,00
100B DIV CX
100D INC BX
100E INC BX
100F MOV [BX],AX
1011 INC BX
1012 INC BX
1013 MOV [BX],DX
1015 HLT
SAMPLE INPUT AND OUTPUT
16-BIT DIVISION
WITHOUT REMAINDER
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA

1200 1300

1201 1301

1202

WITH REMAINDER
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA

1200 1300

1201 1301

1202

2. PROGRAMS FOR LOGICAL OPERATIONS USING 8086

Algorithm

STEP 1: Start the program.


STEP 2: Get the input data’s and stored it in registers.

STEP 3: Perform logical AND,OR, NAND, NOT, NOR, XOR operation

STEP 4: Store the CONCLUSIONs in separate memory locations.

STEP 5: Stop the program

PROGRAM:

LOGICAL OR OPERATION:
ADDRESS LABEL MNEMONICS
1000 MOV SI,1200
1003 MOV AL,[SI]
1005 MOV BL,[SI+01]
1007 OR AL,BL
100A MOV [SI+02],AL
1OOD HLT
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA

1200 1300

1201

LOGICAL AND OPERATION:

ADDRESS LABEL MNEMONICS


1000 MOV SI,1200
1003 MOV AL,[SI]
1005 MOV BL,[SI+01]
1007 AND AL,BL
100A MOV [SI+02],AL
1OOD HLT

INPUT OUTPUT
ADDRESS DATA ADDRESS DATA

1200 1300
1201

LOGICAL NOT OPERATION:

ADDRESS LABEL MNEMONICS


1000 MOV SI,1200
1003 MOV AL,[SI]
1005 NOT AL
1007 MOV [SI+02],AL
100A HLT

INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
1200 1300
1201

LOGICAL NOR OPERATION:


ADDRES
S LABEL MNEMONICS
1000 MOV SI,1200
1003 MOV AL,[SI]
MOV BL,
1005 [SI+01]
1008 OR AL,BL
100A NOT AL
MOV
100C [SI+02],AL
100F HLT
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA

1200 1300

1201
LOGICAL NAND OPERATION:
ADDRES
S LABEL MNEMONICS
1000 MOV SI,1200
1003 MOV AL,[SI]
MOV BL,
1005 [SI+01]
1008 AND AL,BL
100A NOT AL
MOV
100C [SI+02],AL
100F HLT

INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
1200 1300
1201

LOGICAL XOR OPERATION:


ADDRES
S LABEL MNEMONICS
1000 MOV SI,1200
1003 MOV AL,[SI]
MOV BL,
1005 [SI+01]
1007 XOR AL,BL
MOV
100A [SI+02],AL
1OOD HLT

INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
1200 1300
1201

VIVA QUESTIONS

i) Define logic gates.


ii) How do you differentiate different types of logic gates?

iii) What are the universal gates? Why it is called so?

iv) What are the logical instructions in 8086?

v) Draw the truth table for various logic gates?

CONCLUSION:

ASCENDING AND DESCENDING ORDER


EX NO:

DATE:

OBJECTIVE:
To write an Assembly Language Program (ALP) to perform ascending and
descending order using 8086 microprocessor.
COMPONENTS REQUIRED:

S.NO COMPONENTS SPECIFICATION QUANTITY


1. Microprocessor kit 8086 kit 1
2. Power Supply +5 V dc 1
3. Key board - 1

ALGORITHM:

STEP 1: Start the program.

STEP 2: Load the count value in CX register.

STEP 3: Get the first two numbers.

STEP 4: Compare the numbers and exchange if necessary so that the two numbers are
in ascending order/descending order.

STEP 5: Decrement count value.

STEP 6: Get the third number from the array and repeat step no:4 until CX is 0.

STEP 7: Stop the program


FLOW CHART: ASCENDING:
PROGRAM:
ADDRESS LABEL MNEMONICS
1000 MOV DX,0005
1003 DEC DX
1004 ZZZ MOV CX,DX
1006 MOV SI,3000
1009 YYY MOV AX,[SI]
CMP AX,
100D [SI+02]
100E JB XXX
XCHG
1010 [SI+02],AX
1013 XCHG [SI],AX
1015 XXX ADD SI,0002
1019 LOOP YYY
101B DEC DX
101C JNE ZZZ
101E HLT
SAMPLE INPUT AND OUTPUT
ASCENDING ORDER

INPUT OUTPUT
ADDRESS DATA ADDRESS DATA

3000 3000

3001 3001

3002 3002

3003 3003

3004 3004

3005 3005

3006 3006

3007 3007

3008 3008

3009 3009
FLOW CHART:
DESCENDING:

PROGRAM:
ADDRESS LABEL MNEMONICS
1000 MOV DX,0005
1003 DEC DX
1004 ZZZ MOV CX,DX
1006 MOV SI,3000
1009 YYY MOV AX,[SI]
100D CMP AX,
[SI+02]
100E JNB XXX
1010 XCHG
[SI+02],AX
1013 XCHG [SI],AX
1015 XXX ADD SI,0002
1019 LOOP YYY
101B DEC DX
101C JNE ZZZ
101E HLT
SAMPLE INPUT AND OUTPUT
DESCENDING ORDER
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA

3000 3000
3001 3001
3002 3002
3003 3003
3004 3004
3005 3005
3006 3006
3007 3007
3008 3008
3009 3009

CONCLUSION:

LARGEST AND SMALLEST NUMBER


EX NO:

DATE:

OBJECTIVE:
To write an Assembly Language Program (ALP) to perform largest and smallest
number among N numbers using 8086 microprocessor.

COMPONENTS REQUIRED:

S.NO COMPONENTS SPECIFICATION QUANTITY


1. Microprocessor kit 8086 kit 1
2. Power Supply +5 V dc 1
3. Key board - 1

ALGORITHM:

STEP 1: Start the program.

STEP 2: Load the count value in CX register.

STEP 3: Get the first two numbers.

STEP 4: Compare the numbers and exchange if the number is small/large.

STEP 5: Decrement count value.

STEP 6: Get the third number from the array and repeat step no:4 until CX is 0.

STEP 7: Stop the program.

FLOW CHART: LARGEST


PROGRAM:
ADDRE LABE MNEMONI
SS L CS
1000 MOV
CX,0004
MOV
1003 BX,1100
MOV AX,
1006 [BX]
ADD
1008 XXX BX,0002
CMP AX,
100C [BX]
100E JNB YYY
1010 MOV AX,BX
1012 YYY LOOP YYY
MOV
1014 [2500],AX
1016 HLT

SAMPLE INPUT AND OUTPUT

LARGEST NUMBER
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA

4000 5000

4001 5001

4002

4003

4004

4005

4006

4007

4008

4009

FLOW CHART: SMALLEST


PROGRAM:
ADDRE LABE MNEMONI
SS L CS
MOV
1000 CX,0004
MOV
1003 BX,1100
MOV AX,
1006 [BX]
ADD
1008 XXX BX,0002
CMP AX,
100C [BX]
100E JB XXX
1010 MOV AX,BX
1012 YYY LOOP YYY
MOV
1014 [2500],AX
1016 HLT

SMALLEST NUMBER

INPUT OUTPUT
ADDRESS DATA ADDRESS DATA

4000 5000

4001 5001

4002

4003

4004

4005

4006

4007

4008

4009

CONCLUSION:
CODECONVERSIONS

CONVERSION OF BCD TO BINARY AND VICEVERSA


EX NO:

DATE:

OBJECTIVE:
To write an Assembly Language Program (ALP) to convert BCD to BINARY
and vice versa using 8086 microprocessor.

COMPONENTS REQUIRED:

S.NO COMPONENTS SPECIFICATION QUANTITY


1. Microprocessor kit 8086 kit 1
2. Power Supply +5 V dc 1
3. Key board - 1

ALGORITHM:

BCD TO BINARY
STEP 1: Start the program.
STEP 2: Get the input data.
STEP 3: performing AND operation between input and F0.
STEP 4: Rotate right AL with CL.
STEP 5: performing multiplication operation between DH and 0A.
STEP 6: Store the CONCLUSION in memory.
STEP 7: Stop the program.

BINARY TO BCD
STEP 1: Start the program.
STEP 2: Get the input data.
STEP 3: compare and then subtract the value 100 from the input.
STEP 4: compare and then subtract the value 10 from the input.
STEP 5: performing rotate left operation with AL by 04.
STEP 6: Store the CONCLUSION in memory.
STEP 7: Stop the program.

FLOW CHART:
PROGRAM:
BCD TO BINARY

ADDRE LABE MNEMONI


SS L CS
MOV
1000 BX,1100
MOV AL,
1003 [BX]
1005 MOV BL,AL
1007 AND DL,OF
100A AND AL,FO
100C MOV CL,04
100E ROR AL,CL
1010 MOV DH,0A
1012 MUL DH
1014 ADD AL,DL
MOV
1016 [BX+01],AL
1018 HLT

SAMPLE INPUT AND OUTPUT


BCD TO BINARY
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA

1100 1101

BINARY TO BCD

ADDRESS LABEL MNEMONICS


1000 MOV CL,00
1002 MOV BL,CL
1004 MOV SI,2000
1007 MOV AL,[SI]
1009 XXX CMP AL,64
100B JB YYY
100D SUB AL,64
100F INC AL
1011 JMP XXX
1014 YYY CMP AL,04
1016 JB ZZZ
1025 ZZZ JMP YYY
1027 ROL AL,01
102B ADD AL,DL
MOV
102D [SI+01],AL
MOV
1030 [SI+02],CL
1033 HLT

BINARY TO BCD
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA

2001
2000
2002

CONCLUSION:

CONVERSION OF BINARY TO ASCII &VICEVERSA


EX NO:

DATE:

OBJECTIVE:
To write an Assembly Language Program (ALP) to convert BINARY TO ASCII
and vice versa using 8086 microprocessor.

COMPONENTS REQUIRED:
S.NO COMPONENTS SPECIFICATION QUANTITY
1. Microprocessor kit 8086 kit 1
2. Power Supply +5 V dc 1
3. Key board - 1

ALGORITHM:
ASCIITO BINARY
STEP 1: Start the program.

STEP 2: Get the input data.

STEP 3: If the input data is greater than the data 0A add 37 from input otherwise add
30 from the input.

STEP 4: Store the CONCLUSION in separate memory.

STEP 5: Stop the program.

BINARY TO ASCII
STEP 1: Start the program.

STEP 2: Get the input data.

STEP 3: If the input data is greater than the data 0Asubtract 37 from input otherwise
subtract 30 from the input.

STEP 4: Store the CONCLUSION in separate memory.

STEP 5: Stop the program.

FLOWCHART: ASCII TO BINARY


PROGRAM: ASCII TO BINARY

ADDRESS LABEL MNEMONICS


1000 MOV BX,2000
1003 MOV AL,[BX]
1005 CMP AL,0A
1007 JB XXX
1009 ADD AL,07
100B XXX ADD AL, 30
100D INC BX
100E MOV [BX],AL
1010 HLT

SAMPLE INPUT AND OUTPUT

ASCII TO BINARY
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA

2000 2001

FLOWCHART: BINARY TO ASCII


ADDRES LABE MNEMONIC
S L S
1000 MOV BX,2000
1003 MOV AL,[BX]
1005 CMP AL,41
1007 JB XXX
1009 SUB AL,07
100B XXX SUB AL,30
100D INC BX
100E MOV [BX],AL
1010 HLT

PROGRAM: BINARY TO ASCII


BINARY TO ASCII
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA

2000 2001

CONCLUSION:

CONVERSION OF BINARY TO GRAY


EX NO:

DATE:

OBJECTIVE:
To write an Assembly Language Program (ALP) to convert BINARY TO
GRAY.

COMPONENTS REQUIRED:
S.NO COMPONENTS SPECIFICATION QUANTITY
1. Microprocessor kit 8086 kit 1
2. Power Supply +5 V dc 1
3. Key board - 1

ALGORITHM:

STEP 1: Start the program.

STEP 2: Get the input data.

STEP 3: Rotate the input content to right and then store in another register.

STEP 4: Perform X-OR with shifted input and original input.

STEP 5: Store the CONCLUSION.

STEP 6: Stop the program.

FLOW CHART:
PROGRAM:

ADDRE LABE MNEMONI


SS L CS
1000 MOV SI,2000
1003 MOV BL,[SI]
1005 MOV AL,BL
1007 SHR AL,01
1009 XOR AL,BL
100B INC SI
100C MOV [SI],AL
100F HLT

SAMPLE INPUT AND OUTPUT

INPUT OUTPUT
ADDRESS DATA ADDRESS DATA

8200 8201
CONCLUSION:

DECIMAL ARITHMATIC OPERATION

Exp. No
DATE:
OBJECTVE:

To write and execute an assembly language program for performing the decimal operation of 16 bit
numbers with carry.

COMPONENTS REQUIRED:

8086 Trainer kit, Key board, power supply

ALGORITHM:

Step1: Start

Step 2: Move the first data into the accumulator.


Step3: Move the second data in some register pair

Step 4: Initialize carry register.

Step 5: Add the contents of the two registers

Step 6: If carry is generated increment the carry register.

Step 7: Store the contents of accumulator and carry register in memory.

Step 8: Terminate the process

PROGRAM:

ADDRESS LABEL MNEMONICS


MOV CL,00H
MOV SI,1500H
MOV AL,[SI]
INC SI
ADD AL,[SI]
DAA
JNC LABEL1
INC CL
MOV
 LABEL1: DI,1700H
MOV [DI],AL
INC DI
MOV [DI],CL
HLT

SAMPLE INPUT AND OUTPUT

INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
CONCLUSION:

MATRIX OPERATION
EX NO:

DATE:

OBJECTIVE:
To write an Assembly Language Program (ALP) to Add and Subtract two 3x3
matrix using 8086 microprocessor.

COMPONENTS REQUIRED:

S.NO COMPONENTS SPECIFICATION QUANTITY


1. Microprocessor kit 8086 kit 1
2. Power Supply +5 V dc 1
3. Key board - 1

i) ADDITION OF TWO MATRICES


ALGORITHM:

STEP 1: Start the program.

STEP 2: Get the input matrices.


STEP 3: Add the given two matrices.

STEP 4: Store the CONCLUSION in another memory locations.

STEP 5: Stop the program.

FLOW CHART:
PROGRAM: ADDITION OF TWO MATRICES

ADDRESS LABEL MNEMONICS


3000 MOV BX,1300
3003 MOV BP,1400
3006 MOV SI,0000
3009 MOV DI,1500
300C MOV CL,09
300E MOV AL,[BX+SI]
3010 ADD AL,[BP+SI]
3012 MOV [DI],AL
3014 INC SI
3015 INC DI
3016 LOOP 300E
3018 HLT

SAMPLE INPUT AND OUTPUT


ADDITION OF TWO MATRICES

MATRIX A MATRIX B MATRIX C

ADDRESS DATA ADDRESS DATA ADDRESS DATA


1300 01 1400 02 1500 03
1301 01 1401 02 1501 03
1302 01 1402 02 1502 03
1303 01 1403 02 1503 03
1304 01 1404 02 1504 03
1305 01 1405 02 1505 03
1306 01 1046 02 1506 03
1307 01 1407 02 1507 03
1308 01 1408 02 1508 03
ii) SUBTRACT TWO MATRICES

ALGORITHM:

STEP 1: Start the program.

STEP 2: Get the input matrices.

STEP 3: Subtract the given two matrices.

STEP 4: Store the CONCLUSION in another memory locations.

STEP 5: Stop the program.

PROGRAM: SUBTRACTION OF TWO MATRICES

ADDRESS LABEL MNEMONICS


3000 MOV BX,1300
3003 MOV BP,1400
3006 MOV SI,0000
3009 MOV D1,1501
300C MOV CL,09
300E MOV AL,[BX+SI
3010 SUB AL,[BP+SI]
3012 MOV [DI],AL
3014 INC SI
3015 INCDI
3016 LOOP 300E
3018 HLT
SAMPLE INPUT AND OUTPUT
SUBTRACTION OF TWO MATRICES
MATRIX A MATRIX B MATRIX C

ADDRESS DATA ADDRESS DATA ADDRESS DATA


1300 03 1400 02 1500 01
1301 03 1401 02 1501 01
1302 03 1402 02 1502 01
1303 03 1403 02 1503 01
1304 03 1404 02 1504 01
1305 03 1405 02 1505 01
1306 03 1046 02 1506 01
1307 03 1407 02 1507 01
1308 03 1408 02 1508 01

CONCLUSION:
STRING OPERATIONS

MOVING A DATA BLOCK WITHOUT OVERLAP (WITHOUT USING STRING


INSTRUCTIONS)
Exp. No:

DATE:
OBJECTVE:
To write and execute an assembly language program to move a block of data without overlap
using 8086

COMPONENTS REQUIRED:
8086 Trainer kit, Key board, power supply, MASM Software

ALGORITHM

 Initialize counter
 Initialize source block pointer
 Initialize destination block pointer
 Get the byte from source block
 Store the byte in the destination block
 Increment source, destination pointers and decrement counter
 Repeat steps 4,5 and 6 unit counter equal to zero
 Stop

PROGRAM

ADDRESS LABEL MNEMONICS


1000 MOV DX,0005
1003 MOV SI,2000
1006 MOV DI,3000
1009 XXX MOV BL,[SI]
100B MOV [DI],BL
100D INC SI
100E INC DI
100F DEC DX
1010 JNZ XXX
1012 HLT
SAMPLE INPUT AND OUTPUT

INPUT OUTPUT
ADDRESS DATA ADDRESS DATA

MOVING A DATA BLOCK WITHOUT OVERLAP ( USING STRING INSTRUCTIONS)


PROGRAM

Exp. No:

DATE:

OBJECTVE:
To write and execute an assembly language program to move a block of data using string
instructions.

COMPONENTS REQUIRED:
8086 Trainer kit, Key board, power supply, MASM Software

ALGORITHM

 Initialize counter
 Initialize source block pointer
 Initialize destination block pointer
 Get the byte from source block
 Store the byte in the destination block
 Increment source, destination pointers and decrement counter
 Repeat steps 4,5 and 6 unit counter equal to zero
 Stop

PROGRAM:
ADDRESS LABEL MNEMONICS
1000 MOV SI,2000
1003 MOV DI,3000
1006 MOV CX,000F
1009 CLD
100A XXX MOVSB
100B LOOP XXX
100D HLT

SAMPLE INPUT AND OUTPUT

INPUT OUTPUT
ADDRESS DATA ADDRESS DATA

SEARCHING A DATA IN A STRING

EX NO:

DATE:

OBJECTIVE:
To write an Assembly Language Program (ALP) to perform search operation
using 8086 microprocessor.

COMPONENTS REQUIRED:

S.NO COMPONENTS SPECIFICATION QUANTITY


1. Microprocessor kit 8086 kit 1
2. Power Supply +5 V dc 1
3. Key board - 1

ALGORITHM:

STEP 1: Start the program.

STEP 2: Read the count value.

STEP 3: Compare elements to be found with set of elements one by one until if count
becomes zero.
STEP 4: Stop the program

FLOW CHART

PROGRAM:

ADDRESS LABEL MNEMONICS


2000 MOV DI,1100
2003 MOV CX,0005
2006 MOV AL,40
2008 CLD
2009 REPNE
200A SCASB
200B JE XXX
200D MOV DL,FF
200F MOV [1200],DI
2013 JMP YYY
2016 XXX MOV DL,OO
2018 MOV [1200],DL
201C YYY HLT

SAMPLE INPUT OUTPUT

INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
1100 03 1200 00
1101 01
1102 40
1103 02
1104 08

SAMPLE INPUT OUTPUT

INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
1100 03 1200 FF
1101 01
1102 42
1103 02
1104 08
CONCLUSION:

FIND AND REPLACE


EX NO:

DATE:

OBJECTIVE:
To write an Assembly Language Program (ALP) to perform find and replace
operation using 8086 microprocessor.

COMPONENTS REQUIRED:

S.NO COMPONENTS SPECIFICATION QUANTITY


1. Microprocessor kit 8086 kit 1
2. Power Supply +5 V dc 1
3. Key board - 1

ALGORITHM:

STEP 1: Start the program.

STEP 2: Read the count value.

STEP 3: Compare elements to be found with set of elements one by one until if count
becomes zero.

STEP 4: If found replace element it with new value.

STEP 5: Stop the program.

PROGRAM:

ADDRE LABE MNEMONIC


SS L S
1000 MOV DI,1400
1003 MOV CX,0005
1006 CLD
1007 MOV AL,12
1009 XXX MOV BL,30
100B REPNE
100C SCASB
100D DEC DI
100E MOV [DI],BL
1010 LOOP XXX
1012 HLT

SAMPLE INPUT & OUTPUT

INPUT OUTPUT
ADDRESS DATA ADDRESS DATA

CONCLUSION:
FINDING THE LENGTH OF A STRING

EX NO:

DATE:

OBJECTIVE:
To write an Assembly Language Program (ALP) to find the length of a string
using 8086 microprocessor.

COMPONENTS REQUIRED:

S.NO COMPONENTS SPECIFICATION QUANTITY


1. Microprocessor kit 8086 kit 1
2. Power Supply +5 V dc 1
3. Key board - 1

PROGRAM:

ADDRE LABE MNEMONIC


SS L S
1000 MOV DI,4000
1003 MOV SI ,3000
1006 MOV DL,00
1008 MOV AH,FF
100A XXX INC DL
100C MOV AL,[SI]
100E INC SI
100F CMP AH,AL
1011 JNZ XXX
1013 MOV [DI],DL
1015 HLT

SAMPLE INPUT & OUTPUT

INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
CONCLUSION:

COMPARING A STRING
EX NO:

DATE:

OBJECTIVE:
To write an Assembly Language Program (ALP) to perform to compare a string
using 8086 microprocessor.

COMPONENTS REQUIRED:

S.NO COMPONENTS SPECIFICATION QUANTITY


1. Microprocessor kit 8086 kit 1
2. Power Supply +5 V dc 1
3. Key board - 1

ALGORITHM:
STEP 1: Start the program.
STEP 2: Set the DI to point the source array
STEP 3: Move the string size to CX register
STEP 4: Move the data to AL
STEP 5: Direction flag is cleared so that SI & DI will auto increment after each loop.
STEP 6: Repeat
STEP 7: Store the bytes of string using MOVSB instruction.
STEP 8: Stop the program.
PROGRAM:

ADDRESS LABEL MNEMONICS


1000 MOV SI,1200
1003 MOV DI,1300
1006 MOV CL,0005
1009 CLD
100A REP CMPSB
100B JNE XXX
100D MOV DL,00
100F MOV [0700],DL
1013 JMP YYY
1016 XXX MOV DL,FF
1018 MOV [0700],DL
101C YYY HLT

SAMPLE INPUT AND OUTPUT

INPUT1 INPUT 2 OUTPUT


ADDRESS DATA ADDRESS DATA ADDRESS DATA
1200 00 1300 00 0700 FF
1201 01 1301 01
1202 00 1302 00
1203 02 1303 03
1204 20 1304 20
INPUT1 INPUT 2 OUTPUT
ADDRESS DATA ADDRESS DATA ADDRESS DATA
1200 00 1300 00 0700 00
1201 01 1301 01
1202 00 1302 00
1203 02 1303 02
1204 00 1304 00

CONCLUSION:

REVERSING A STRING
EX NO:

DATE:
OBJECTIVE:
To write an Assembly Language Program (ALP) to reverse a string using 8086
microprocessor.

COMPONENTS REQUIRED:

S.NO COMPONENTS SPECIFICATION QUANTITY


1. Microprocessor kit 8086 kit 1
2. Power Supply +5 V dc 1
3. Key board - 1

PROGRAM:

ADDRESS LABEL MNEMONICS


1000 MOV SI,1200
1003 MOV DI,1305
1006 MOV CL,05
1008 XXX CLD
1009 LODSB
100A STD
100B STOSB
100C LOOP XXX
100E HLT

SAMPLE INPUT AND OUTPUT

INPUT1 INPUT 2 OUTPUT


ADDRESS DATA ADDRESS DATA ADDRESS DATA
CONCLUSION:

EXPERIMENTS USING MASM ASSEMBLER


ARITHMETIC OPERATIONS USING MASM

EXPT NO:
16 – BIT ADDITION USING MASM
DATE:
OBJECTIVE:
To write a MASM program to perform 16–bit arithmetic operations using instruction set of 8086
microprocessor.

COMPONENTS REQUIRED:
MASM software, Personal Computer.

ALGORITHM:

Step 1: Start the program.


Step 2: Get the input data’s and stored it in registers.
Step 3: Addition operation is performed using sequence of instruction.
Step 4: Store the CONCLUSION in separate memory location.
Step 5: Stop the program

PROGRAM:

.model small
.code
start:
mov ax,4000h
mov bx,4000h
add ax,bx
int 3
end start

OUTPUT:

INPUT OUTPUT

16 – BIT SUBTRACTION USING MASM

ALGORITHM:

Step 1: Start the program.


Step 2: Get the input data’s and stored it in registers.
Step 3: Subtraction operation is performed using sequence of instruction.
Step 4: Store the CONCLUSION in separate memory location.
Step 5: Stop the program

PROGRAM:
.model small
.code
start:
mov ax,4000h
mov bx,4000h
sub ax,bx
int 3
end start

OUTPUT:

INPUT OUTPUT

16 – BIT MULTIPLICATION USING MASM

ALGORITHM:

Step 1: Start the program.


Step 2: Get the input data’s and stored it in registers.
Step 3: Multiplication operation is performed using sequence of instruction.
Step 4: Store the CONCLUSION in separate memory location.
Step 5: Stop the program

PROGRAM:

.model small
.code
start:
mov ax,0008h
mov bx,0004h
mul bx ;32 bit answer available in dx#ax reg;
int 3
end start

OUTPUT:
INPUT OUTPUT

16 – BIT DIVISION USING MASM

ALGORITHM:

Step 1: Start the program.


Step 2: Get the input data’s and stored it in registers.
Step 3: Division operation is performed using sequence of instruction.
Step 4: Store the CONCLUSION in separate memory location.
Step 5: Stop the program

PROGRAM:

.model small
.code
start:
mov ax,0000h
mov dx,0001h
mov bx,0002h
div bx ;quotient in ax;remainder in dx;
int 3
end start

OUTPUT:

INPUT OUTPUT
CONCLUSION:

LOGICAL OPERATIONS USING MASM

EXPT NO:
DATE:

OBJECTIVE:
To write a MASM program to perform logical operations using instruction set of 8086
microprocessor.

COMPONENTS REQUIRED:
MASM software, Personal Computer.

ALGORITHM:

Step 1: Start the program.


Step 2: Get the input data’s and stored it in registers.
Step 3: Logical operations are performed using sequence of instruction.
Step 4: Store the CONCLUSION in separate memory location.
Step 5: Stop the program

PROGRAM:

LOGICAL AND OPERATION

.model small
.code
start:
mov al,85h
mov bl,99h
and al,bl
int 3h
end start

OUTPUT:

INPUT OUTPUT
LOGICAL OR OPERATION

.model small
.code
start:
mov al,85h
mov bl,99h
or al,bl
int 3h
end start

OUTPUT:

INPUT OUTPUT

LOGICAL NOT OPERATION

.model small
.code
start:
mov al,85h
not al
int 3h
end start

OUTPUT:

INPUT OUTPUT
LOGICAL NAND OPERATION

.model small
.code
start:
mov al,85h
mov bl,99h
and al,bl
not al
int 3h
end start

OUTPUT:

INPUT OUTPUT

LOGICAL NOR OPERATION

.model small
.code
start:
mov al,85h
mov bl,99h
or al,bl
not al
int 3h
end start

OUTPUT:

INPUT OUTPUT

LOGICAL XOR OPERATION

.model small
.code
start:
mov al,85h
mov bl,99h
xor al,bl
int 3h
end start

OUTPUT:

INPUT OUTPUT

CONCLUSION:

SORTING OPERATIONS USING MASM


EXPT NO:
SORTING OF ‘N’ NUMBERS IN ASCENDING ORDER
DATE:

OBJECTIVE:
To write a MASM program to perform sorting operations using instruction set of 8086
microprocessor.

COMPONENTS REQUIRED:
MASM software, Personal Computer.

ALGORITHM:

Step 1: Start the program.


Step 2: Get the input data’s and stored it in registers.
Step 3: Sorting operation is performed using sequence of instruction.
Step 4: Store the CONCLUSION in separate memory location.
Step 5: Stop the program

PROGRAM:

DATA SEGMENT
STRING1 DB 99H,12H,56H,45H,36H
DATA ENDS

CODE SEGMENT
ASSUME CS:CODE,DS:DATA
START: MOV AX,DATA
MOV DS,AX

MOV CH,04H

UP2: MOV CL,04H


LEA SI,STRING1

UP1: MOV AL,[SI]


MOV BL,[SI+1]
CMP AL,BL
JC DOWN
MOV DL,[SI+1]
XCHG [SI],DL
MOV [SI+1],DL

DOWN: INC SI
DEC CL
JNZ UP1
DEC CH
JNZ UP2

INT 3
CODE ENDS
END START

OUTPUT:

INPUT OUTPUT

SORTING OF ‘N’ NUMBERS IN DESCENDING ORDER

PROGRAM:

DATA SEGMENT
STRING1 DB 99H,12H,56H,45H,36H
DATA ENDS
CODE SEGMENT
ASSUME CS:CODE,DS:DATA
START: MOV AX,DATA
MOV DS,AX
MOV CH,04H
UP2: MOV CL,04H
LEA SI,STRING1

UP1:MOV AL,[SI]
MOV BL,[SI+1]
CMP AL,BL
JNC DOWN
MOV DL,[SI+1]
XCHG [SI],DL
MOV [SI+1],DL

DOWN: INC SI
DEC CL
JNZ UP1
DEC CH
JNZ UP2
INT 3
CODE ENDS
END START

OUTPUT:

INPUT OUTPUT

CONCLUSION:

DISPLAY SYSTEM TIME USING MASM


EXPT NO:

DATE:

OBJECTIVE: To write a MASM program to perform displaying system time using instruction set of
8086 microprocessor.

COMPONENTS REQUIRED: MASM software, Personal Computer.

MASM Program:

.MODEL SMALL
.STACK 100
.DATA
String1 DB 'The Time is'
String2 DB 2 DUP (0), ':'
String3 DB 2 DUP (0), ':'
String4 DB 2 DUP (0), 0Dh, 0Ah, '$'
Hours DB 0
Minutes DB 0
Seconds DB 0
.CODE
MAIN PROC
MOV AX,@DATA
MOV DS, AX
MOV AH,2Ch
INT 21h
MOV Hours, CH
MOV Minutes, CL
MOV Seconds, DH
LEA BX, String2 + 2
XOR AX,AX
MOV AL, Hours
CALL Numasc
MOV [BX], AX
LEA BX, String3 + 2
XOR AX,AX
MOV AL, Minutes
CALL Numasc
MOV [BX], AX
LEA BX, String4 + 2
XOR AX,AX
MOV AL, Seconds
CALL Numasc
MOV [BX],AX
LEA DX, String1
MOV AH,00
MOV AL,03
INT 10h
MOV AH,09h
INT 21h
MOV AH, 08H ;4Ch
INT 21h
MAIN ENDP
NUMASC PROC
MOV AH,00
MOV DL,10

DIV DL
OR AX,3030h
RET
NUMASC ENDP
END

OUTPUT:

CONCLUSION:
The MASM Program to perform displaying system time using instruction set of 8086 microprocessor has
been written and executed successfully.
PRINTER STATUS CHECKING USING MASM
EXPT NO:

DATE:

OBJECTIVE: To write a MASM program to check the status of printer using instruction set of 8086
microprocessor.

COMPONENTS REQUIRED: MASM software, Personal Computer.


MASM Program:

name printmsg
page 60,80
title program to send a message to printer
.model small
.stack 64
.data
msg db 'If this is Printed on paper',0dh,0ah
db 'Then Program is Working',0dh,0ah
len equ $-msg
errmsg db 'Error! Printer is not connected or switched off',0dh,0ah,'$'
.code
main:
mov ax,@data
mov ds,ax
mov ah,02h ;get printer status
mov dx,0 ;printer 0
int 17h ;returns with ah=status
rol ah,01 ;if ah7=1 then printer is ready | mov ah7 to carry flag
jc online
offline:
lea dx,errmsg
mov ah,09h ;displays errmsg
int 21h
jmp exit
online:
mov cx,len
mov si,00h
mov ah,05h ;prints the char in dl on printer
again:
mov dl,msg[si]
int 21h
inc si
loop again ;dec cx,until cx=0
exit:
mov ah,4ch
int 21h
end main
CONCLUSION:

GENERATING TIME DELAY USING MASM


EXPT NO:

DATE:

OBJECTIVE: To write a MASM program to generate time delay using instruction set of 8086
microprocessor.

COMPONENTS REQUIRED: MASM software, Personal Computer.

MASM Program:

.model small
.data
msgin db 'enter delay duration(0-50);$'
msg1 db 'WELCOME TO CHENNAI!$'
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
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

OUTPUT:
CONCLUSION:

PASSWORD CHECKING USING MASM


EXPT NO:

DATE:

OBJECTIVE: To write a MASM program to check Password using instruction set of 8086
microprocessor.

COMPONENTS REQUIRED: MASM software, Personal Computer.

MASM Program:

name checkpassword
page 60,80
title to check for password using DOS function call
.model small
.stack 64
.data
cr equ 13
lf equ 10
password db 'INDIA$'
prompt db 'Enter Password & then <cr> (Max 40 chars)',cr,lf,'$'
entry db 41 dup(?)
msgsuc db 'You are Authorized person',cr,lf,'$'
msgfail db 'Wrong Password! Try Again',cr,lf,'$'
.code
pass:
mov ax,@data
mov ds,ax
mov es,ax
lea dx,prompt
mov ah,09h
int 21h
mov bp,0
tryagain:
mov cx,40
mov bx,0
again:
mov ah,08h ;read a char from KB w/o echoing on screen
int 21h ;stores the char read in al
cmp al,0dh ;cmp al with <cr>(0dh)
je action
mov entry[bx],al ;store the chars read in entry[]A
inc bx
loop again ;to read next char from KB
action:
mov entry[bx],'$' ;store $ at the end of the array
lea si,password
lea di,entry
mov cx,06 ;cx=6 length of the password
repe cmpsb ;cmp si(password) & di(entry)
je sucmsg
lea dx,msgfail
mov ah,09h
int 21h
jmp tryagain
sucmsg:
lea dx,msgsuc
mov ah,09h
int 21h
mov ah,4ch
int 21h
end pass

OUTPUT:
CONCLUSION:

PALINDROME CHECKING USING MASM

EXPT NO:

DATE:

OBJECTIVE: To write a MASM program to check whether the given string is palindrome or not
using instruction set of 8086 microprocessor.

COMPONENTS REQUIRED: MASM software, Personal Computer.

MASM Program:

DATA SEGMENT
STR1 DB "ENTER YOUR STRING HERE ->$"
STR2 DB "YOUR STRING IS ->$"
STR3 DB "REVERSE STRING IS ->$"
INSTR1 DB 20 DUP("$")
RSTR DB 20 DUP("$")
NEWLINE DB 10,13,"$"
N DB ?
S DB ?
MSG1 DB "STRING IS PALINDROME$"
MSG2 DB "STRING IS NOT PALINDROME$"
A DB "1"

DATA ENDS

CODE SEGMENT
ASSUME DS:DATA,CS:CODE
START:

MOV AX,DATA
MOV DS,AX

LEA SI,INSTR1

;GET STRING
MOV AH,09H
LEA DX,STR1
INT 21H

MOV AH,0AH
MOV DX,SI
INT 21H

MOV AH,09H
LEA DX,NEWLINE
INT 21H

;PRINT THE STRING

MOV AH,09H
LEA DX,STR2
INT 21H

MOV AH,09H
LEA DX,INSTR1+2
INT 21H

MOV AH,09H
LEA DX,NEWLINE
INT 21H

;PRINT THE REVERSE OF THE STRING

MOV AH,09H
LEA DX,STR3
INT 21H

MOV CL,INSTR1+1
ADD CL,1
ADD SI,2

L1:
INC SI

CMP BYTE PTR[SI],"$"


JNE L1

DEC SI

LEA DI,RSTR

L2:MOV AL,BYTE PTR[SI]

MOV BYTE PTR[DI],AL

DEC SI
INC DI
LOOP L2

MOV AH,09H
LEA DX,NEWLINE
INT 21H

MOV AH,09H
LEA DX,RSTR
INT 21H

MOV AH,09H
LEA DX,NEWLINE
INT 21H

;PRINT THE STRING IS PALINDROME OR NOT

LEA SI,INSTR1
LEA DI,RSTR

MOV AH,09H
LEA DX,NEWLINE
INT 21H

ADD SI,2

L7:
MOV BL,BYTE PTR[DI]

CMP BYTE PTR[SI],BL


JNE LL2

INC SI
INC DI
MOV BL,BYTE PTR[DI]

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

MOV AH,09H
LEA DX,NEWLINE
INT 21H

CMP BYTE PTR[DI],"$"


JNE L7

MOV AH,09H
LEA DX,NEWLINE
INT 21H

MOV AH,09H
LEA DX,MSG1
INT 21H

JMP L5

LL2:
MOV AH,09H
LEA DX,NEWLINE
INT 21H

MOV AH,09H
LEA DX,MSG2
INT 21H

L5:

MOV AH,4CH
INT 21H

CODE ENDS
END START
CONCLUSION:

8086 INTERFACING EXPERIMENTS


8255 INTERFACE – KIT TO KIT COMMUNICATION USING 8255

EXP NO.:

DATE:

OBJECTIVE: To connect two 8086 microprocessor kits and to serially communicate with
each other by considering transmitter and receiver kits.

COMPONENTS REQUIRED:

Procedure

1. Take two no of 8086 microprocessor kits.

2. Enter the transmitter program in transmitter kit.

3. Enter the receiver program in receiver kit.

4. Interface the two kits with 9-9 serial cable in the serial port of the microprocessor kits. (LCD kit means
PC-PC cable. LED kit means kit-kit cable)

5. Enter the data in transmitter kit use the memory location 1500.

6. Execute the receiver kit.

7. Execute the transmitter kit.

8. Result will be available in receiver kit memory location 1500.


TRANSMITTER PROGRAM:

ADDRE LABE MNEMONIC


SS L S
0400 MOV AL,08
0402 OUT 66,AL
0404 MOV AL,80
0406 OUT 60,AL
0408 HLT

RECEIVER PROGRAM:

ADDRE LABE MNEMONIC


SS L S
0400 MOV SI,2000
0403 MOV AL,90
0405 OUT 66,AL
0407 IN AL,60
0409 MOV [SI],AL
040B HLT
CONCLUSION:

8279 INTERFACE

KEYBOARD AND DISPLAY INTERFACING


EX NO:

DATE:

OBJECTIVE:
To write an Assembly Language Program (ALP) for interfacing of keyboard and
display Using 8086 microprocessor.
COMPONENTS REQUIRED:

S.NO COMPONENTS SPECIFICATION QUANTITY


1. Microprocessor kit 8086 kit 1
2. Power Supply +5 V dc 1
3. Key board - 1
4. 8279 interface card - 1

ALGORITHM:
STEP 1: Start the program.
STEP 2: Initialize 8279 with 8 digits of display by sending command (00) to port.
STEP 3: Locate the first digit address with auto increment mode by sending
command(90) to port..
STEP 4:Send seven- segment code(3F)for ”0”.
STEP 5: Send seven- segment code(3F)for ”1”..
STEP 6: Send seven- segment code(3F)for ”2”..
STEP 7: Send seven- segment code(3F)for ”3”..
STEP 8: stop the program.
DISPLAYING A SINGLE CHARACTER

FLOW CHART:
PROGRAM:

ADDRESS LABEL MNEMONICS


0400 MOV AL,00
0402 OUT 66,AL
0404 MOV AL,D0
0406 OUT 66,AL
0408 MOV AL,90
040A OUT 66,AL
040C MOV AL,D6
040E OUT 60,AL
0410 LOOP 040E
0412 HLT

SEVEN SEGMENT DISPLAY:

Control word format:


DISPLAYING A MESSAGE STRING:

ADDRE LABE MNEMONIC


SS L S
STAR
0400 T MOV SI,1200
0403 MOV CX,0006
0406 MOV AL,00
0408 OUT 66,AL
040A MOV AL,D0
040C OUT 66,AL
040E MOV AL,90
0410 OUT 66,AL
0412 LOOP MOV AL,[SI]
0414 OUT 60,AL
0416 CALL 041F
0419 INC SI
041A LOOP 0412
041C JMP 0400
DELA MOV
041F Y DX,FFFF
LOOP
0422 1 DEC CX
0423 JNZ LOOP1
0425 HLT

CONCLUSION:

8253 INTERFACE – SQUARE WAVE INTERFACE USING 8253


EX NO:

DATE:

OBJECTIVE:
To write an Assembly Language Program (ALP) for interfacing of counterusing 8086
microprocessor.
COMPONENTS REQUIRED:

S.NO COMPONENTS SPECIFICATION QUANTITY


1. Microprocessor kit 8086 kit 1
2. Power Supply +5 V dc 1
3. Key board - 1
4. 8253 interface card - 1
5. CRO - 1

ALGORITHM:
STEP 1: Start the program.
STEP 2: Set a control word for counter 2 in mode -3(Square wave generation).
STEP 3: Give the lower byte of count value
STEP 4:Give the higher byte of count value.
STEP 5: Stop the program.

CONTROL WORD FORMAT:


FLOW CHART:

PROGRAM:

ADDRE LABE MNEMONIC


SS L S
0400 MOV AL,36
0402 OUT 66,AL
0404 MOV AL,0A
0406 OUT 60,AL
0408 MOV AL,00
040A OUT 60,AL
040C JMP 0400

OBSERVATION
S.No TIME PERIOD(msec) AMPLITUDE (volts)
CONCLUSION:

STEPPER MOTOR INTERFACING


EX NO:

DATE:

OBJECTIVE:
To write an Assembly Language Program (ALP) for interfacing stepper motor
Using 8086 microprocessor.
COMPONENTS REQUIRED:

S.NO COMPONENTS SPECIFICATION QUANTITY


1. Microprocessor kit 8086 kit 1
2. Power Supply +5 V dc 1
3. Key board - 1
4. Stepper motor card - 1
5. Stepper motor power 1
+5 V dc
supply

ALGORITHM:

STEP 1: Start the program.


STEP 2: Move the data 66 to Accumulator.
STEP 3: Send the data in Acc to I/O port.
STEP 4: Wait for some time (small delay).
STEP 5: Rotate the Acc contents left/right by one bit.
STEP 6: Repeat from step 2.

90° PHASE SHIFT:

STEP 1Move the data 66 to Accumulator.


STEP 2: Move the count for 90 degree to AH register. (Count=Angle to be
rotated/Angle for one step for motor)
STEP 3: Send the data in Acc to I/O port.
STEP 4: Wait for some time (small delay).
STEP 5: Rotate the Acc contents left/right by one
bit.
STEP 6: Repeat from step 2.

FLOW CHART:
CLOCKWISE DIRECTION:
ANTI-CLOCKWISE DIRECTION
90° PHASE SHIFT:
PROGRAM:

Rotation in clockwise direction:

ADDRESS LABEL MNEMONICS


0400 MOV AL,80
0402 OUT 76,AL
0404 START MOV AL,F9
0406 OUT 70,AL
CALL 0423
0408 (DELAY)
040B MOV AL,F5
040D OUT 70,AL
CALL 0423
040F (DELAY)
0412 MOV AL,F6
0414 OUT 70,AL
CALL 0423
0416 (DELAY)
0419 MOV AL,FA
041B OUT 70,AL
CALL 0423
041D (DELAY)
0421 JMP 0404 (START)
0424 DELAY MOV CX,FFFF
0427 LP1 DEC CX
0428 JNZ LP1
0429 RET
Rotation in anti clockwise direction:

ADDRES LABE
S L MNEMONICS
0400 MOV AL,80
0402 OUT 76,AL
STAR
0404 T MOV AL,FA
0406 OUT 70,AL
CALL 0423
0408 (DELAY)
040B MOV AL,F6
040D OUT 70,AL
CALL 0423
040F (DELAY)
0412 MOV AL,F5
0414 OUT 70,AL
CALL 0423
0416 (DELAY)
0419 MOV AL,F9
041B OUT 70,AL
CALL 0423
041D (DELAY)
JMP 0404
0421 (START)
DELA
0424 Y MOV CX,0000
0427 LP1 DEC CX
0428 JNZ LP1
0429 RET
CONCLUSION:

DIGITAL CLOCK INTERFACING WITH 8086


EXP NO.:
DATE:

OBJECTIVE :

To display the digital clock specifically by displaying the hours, minutes and seconds
using 8086 kits

COMPONENTS required :

1. Microprocessor kit 8086


2. Power Supply 5V

ALGORITHM:

HARDWARE INSTALLATION:

STEP 1: Start the program.

STEP 2: Connect RTC Interfacing module to 50 Pin Bus of 8086 Trainer Kit through 50 pin FRC
Cable.

STEP 3: Be sure about the direction of the cable i.e. pin No. 1 of module should be connected to Pin
No. 1 of 50 pin connector.

STEP 4: Connect +5V, GND from the trainer kit (+5V & GND signals are available in the 50 pin of
FRC Connector).

SOFTWARE INSTALLATION :

STEP 1: Enter the program from 0:400 of 8086 Kit. Make sure that your program is entered properly
before execution.

STEP 2: Execute your program from respective location & observe the results.
PROGRAM:
CONCLUSION:

8251-INTERFACING :(KIT-PC INTERFACING)


EXP NO.:
DATE:

OBJECTIVE :

To interface 8251 kit to PC to transfer data .

COMPONENTS required :

1. Microprocessor kit 8086


2. Power Supply 5V

PROGRAM:

ADDRESS LABEL MNEMONICS


1000 MOV AL,B6
1002 OUT 06,AL
1004 MOV AL,07
1006 OUT 04,AL
1008 MOV AL,00
100A OUT 04,AL
100C MOV AL,4E
100E OUT 66,AL
1010 MOV AL,05
1012 OUT 66,AL
1014 PPP IN AL,66
1016 AND AL,02
1018 JZ PPP
101A IN AL,60
101C MOV BL,AL
101E NOP
101F KKK IN AL,66
1021 AND AL,01
1023 JZ KKK
1025 MOV AL,BL
1027 OUT 60,AL
1029 JMP PPP

CONCLUSION:

DAC INTERFACING
EX NO:
DATE:

OBJECTIVE:
To write an Assembly Language Program (ALP) for interfacing of DAC
Using 8051 microcontroller.
COMPONENTS REQUIRED:

S.NO COMPONENTS SPECIFICATION QUANTITY


1. Microcontroller kit 8051 kit 1
2. Power Supply +5 V dc 1
3. Key board - 1
4. DAC interface card - 1
5. CRO - 1

ALGORITHM:
SQUARE WAVE:
STEP 1: Start the program.
STEP 2: Load accumulator with 00 and send it to the D/A convertor.
STEP 3: Call a delay of 1ms which is the off-time delay.
STEP 4:Initialize D/A convertor by sending FF to the output port.
STEP 5: Call a delay of 1ms which is the on-time delay.
STEP 6: Repeat the loop.

TRIANGULAR WAVE:
STEP 1: Start the program.
STEP 2: Load accumulator with 00 and send it to the D/A convertor.
STEP 3: Increment the data and send it to the accumulator.
STEP 4:Repeat the loop until Accumulator reaches 00.
STEP 5: Load accumulator with FF and send it to the D/A convertor.
STEP 6: Decrement the data and send it to the accumulator.
STEP 7:Repeat the loop until Accumulator reaches 00.
STEP 8:Repeat the process again and again.
SAWTOOTH WAVE:
STEP 1: Start the program.
STEP 2: Load accumulator with 00 and send
it to the D/A convertor.
STEP 3: Increment the data and send it to the
accumulator.
STEP 4:Repeat the process unconditionally.

FLOW CHART:
SQUARE WAVE
SAWTOOTH WAVE:

TRIANGULAR WAVE:
PROGRAM:
Square wave generation:

ADDRES
S LABEL MNEMONICS
0400 MOV AL,80
0402 OUT 76,AL
0404 MOV AL,00
0406 OUT 70,AL
0408 OUT 72,AL
040A MOV AL,FF
040C OUT 70,AL
040E OUT 72,AL
0412 HLT

Sawtooth wave generation:


ADDRES
S LABEL MNEMONICS
0400 MOV AL,80
0402 OUT 76,AL
0404 MOV AL,00
0406 OUT 70,AL
0408 OUT 72,AL
040A INC AL
040C JMP 0404

Triangular wave generation:


ADDRESS LABEL MNEMONICS
1000 MOV AL,80
1002 OUT 76,AL
1004 XX MOV AL,00
1006  YY OUT 70,AL
1008 OUT 72,AL
100A INC AL
100C CMP AL,FF
100F JNZ YY
1010 MOV AL,FF
1012 ZZ OUT 70,AL
1014 OUT 72,AL
1016 DEC AL
1018 CMP AL,00
101A JNZ ZZ
101D JMP XX

OBSERVATION
S.No TIME PERIOD(msec) AMPLITUDE (volts)
CONCLUSION:

ADC INTERFACING

EX NO:
DATE:

OBJECTIVE:
To write an Assembly Language Program (ALP) for interfacing of ADC
Using 8086 microprocessor.
COMPONENTS REQUIRED:

S.NO COMPONENTS SPECIFICATION QUANTITY


1. Microcontroller kit 8051 kit 1
2. Power Supply +5 V dc 1
3. Key board - 1
4. DAC interface card - 1
5. CRO - 1

PROGRAM:
ADDRESS LABEL MNEMONICS
1000 MOV AL,98
1002 OUT 76,AL
1004 KKK MOV AL,00
1006 OUT 72,AL
1008 MOV AL,00
100A OUT 74,AL
100C MOV AL,03
100E OUT 74,AL
1010 MOV AL,00
1012 OUT 74,AL
1014 PPP IN 74,AL
1016 AND AL,10
1018 JE PPP
101A MOV AL,04
101C OUT 74,AL
101E IN AL,70
1020 MOV(1300),AL
1024 JMP KKK
1027 HLT

CONCLUSION:
TRAFFIC LIGHT CONTROLLER (TLC) INTERFACING
EX NO:
DATE:

OBJECTIVE:
To write an Assembly Language Program (ALP) for interfacing of traffic light
controller using8086 microprocessor .
COMPONENTS REQUIRED:

S.NO COMPONENTS SPECIFICATION QUANTITY


1. Microprocessor kit 8086 kit 1
2. Power Supply +5 V dc 1
3. Key board - 1
4. TLC card - 1

ALGORITHM:
STEP 1: Start the program.
STEP 2: Initialize all the three ports of 8255 as output ports.
STEP 3: Turn on DON’T WALK signals in all the roads.
STEP 4: Turn on GO signal in road 1.
STEP 5: Turn on READY signal in road 2 and STOP signal in all other roads.
STEP 6: Turn on GO signal in road 2.
STEP 7: Turn on READY signal in road 3 and STOP signal in all other roads.
STEP 8: Turn on GO signal in road 3.
STEP 9: Turn on READY signal in road 4 and STOP signal in all other roads
STEP 10: Turn on GO signal in road 4

PROGRAM:
ADDRESS LABEL MNEMONICS
1000 MOV AL,80
1002 OUT 76,AL
1004 MOV AL,11
1006 OUT 70,AL
1008 OUT 74,AL
100A CALL DELAY1
100D START MOV AL,44
100F OUT 70,AL
1011 CALL DELAY1
1014 MOV AL,22
1016 OUT 70,AL
1018 CALL DELAY2
101B MOV AL,99
101D OUT 70,AL
1022 MOV AL,22
1024 OUT 70,AL
1026 CALL DELAY2
1029 MOV AL,11
102B OUT 70,AL
102D MOV AL,44
102F OUT 74,AL
1031 CALL DELAY1
1034 MOV AL,22
1036 OUT AL,22
1038 CALL DELAY2
103B MOV AL,99
103D OUT 74,AL
103F CALL DELAY1
1042 MOV AL,22
1044 OUT 74,AL
1046 CALL DELAY2
1049 MOV AL,11
104B OUT 74,AL
104D JMP START
1050 DELAY1 MOV BX,000F
1053 DELAY2 MOV CX,0FFF
1056 DL 1 DEC CX
1057 JNZ DL1
1059 DL 1 DEC BX
105A JNZ DL2
105B RET

BIT PATTERNS
5029 B4 60 09 20
502D 9C 40 0B 05
5031 96 40 0B 20
5035 E4 40 0B 05
5039 A4 41 0B 20
503D B4 40 0E 05
5041 B4 40 1A 20
5045 31 12 23 10
5049 B4 C0 09 05
CONCLUSION:

8051 MICROCONTROLLER EXPERIMENTS


EXECUTION PROCEDURE FOR 8051
Writing a alp program into 8051:
Switch on kit
Press reset
Press A (give starting address)
Press enter
st
Enter 1 mnemonic
Press enter
Enter 2nd mnemonic
Press enter
---
---
---
Enter nth mnemonic
Press enter
Press enter
Press enter
Display: A D G M T S
To compile:
Press G (give starting address)
Press enter
Display: program executed
Result:
Press R
A, B, R0, -------, Rn

8 BIT ARTITHMETIC OPERATIONS


EX NO:

DATE:

OBJECTIVE:
To write an Assembly Language Program (ALP) to perform 8-bit arithmetic
operations using 8051 micro controller.

COMPONENTS REQUIRED:

S.NO COMPONENTS SPECIFICATION QUANTITY


1. Microcontroller kit 8051 kit 1
2. Power Supply +5 V dc 1
3. Key board - 1

ALGORITHM:

STEP 1: Start the program.

STEP 2: Get the input data’s and stored it in registers.


STEP 3: Addition operation is performed on given input data.

STEP 4: Store the CONCLUSIONs in separate memory locations.

STEP 5: Stop the program

FLOW CHART:
PROGRAM:
ADDITION:

ADDRES
S LABEL MNEMONICS
3000 MOV A,#02
3002 MOV B,#04
3005 ADD A,B
3007 MOV DPTR,#4500
300A MOVX @DPTR,A
300B SJMP 300B

SAMPLE INPUT AND OUTPUT

INPUT OUTPUT
ADDRESS DATA ADDRESS DATA

SUBTRACTION:
ADDRES
S LABEL MNEMONICS
3000 MOV A,#06
3002 MOV B,#04
3005 SUB A,B
3007 MOV DPTR,#4500
300A MOVX @DPTR,A
300B SJMP 300B

SAMPLE INPUT AND OUTPUT

INPUT OUTPUT
ADDRESS DATA ADDRESS DATA

MULTIPLICATION:
ADDRES
S LABEL MNEMONICS
3000 MOV A,#06
3002 MOV B,#04
3005 MUL AB
3007 MOV DPTR,#4500
300A MOVX @DPTR,A
300B SJMP 300B

SAMPLE INPUT AND OUTPUT

INPUT OUTPUT
ADDRESS DATA ADDRESS DATA

DIVISION:
ADDRES
S LABEL MNEMONICS
3000 MOV A,#06
3002 MOV B,#02
3005 DIV AB
3007 MOV DPTR,#4500
3009 MOVX @DPTR,A
300A INC DPTR
300B MOV A,B
300C MOV @DPTR,A
300F SJMP 300F

SAMPLE INPUT AND OUTPUT


INPUT OUTPUT
ADDRESS DATA ADDRESS DATA

CONCLUSION:

LOGICAL OPERATIONS

EX NO:

DATE:

OBJECTIVE:
To write an Assembly Language Program (ALP) to perform 8-bit logical
operations using 8051 micro controller.

COMPONENTS REQUIRED:

S.NO COMPONENTS SPECIFICATION QUANTITY


1. Microcontroller kit 8051 kit 1
2. Power Supply +5 V dc 1
3. Key board - 1

ALGORITHM:

STEP 1: Start the program.

STEP 2: Get the input data’s and stored it in registers.

STEP 3: Logical operation is performed on given input data.

STEP 4: Store the CONCLUSIONs in separate memory locations.

STEP 5: Stop the program


PROGRAM:
AND LOGIC:
ADDRES
S LABEL MNEMONICS
3000 MOV A,#02
3002 MOV B,#04
3004 ANL A,B
3005 MOV DPTR,#4500
3008 MOVX @DPTR,A
3009 SJMP 3009

SAMPLE INPUT AND OUTPUT

INPUT OUTPUT
ADDRESS DATA ADDRESS DATA

OR LOGIC:

ADDRES
S LABEL MNEMONICS
3000 MOV A,#02
3002 MOV B,#04
3004 ORL A,B
3005 MOV DPTR,#4500
3008 MOVX @DPTR,A
3009 SJMP 3009

NOR LOGIC:

ADDRES
S LABEL MNEMONICS
3000 MOV A,#02
3002 MOV B,#04
3005 ORL A,B
3007 CPL A
3008 MOV DPTR,#4500
300B MOVX @DPTR,A
300C SJMP 300C

SAMPLE INPUT AND OUTPUT

INPUT OUTPUT
ADDRESS DATA ADDRESS DATA

NAND LOGIC:
ADDRES
S LABEL MNEMONICS
3000 MOV A,#02
3002 MOV B,#04
3005 ANL A,B
3007 CPL A
3008 MOV DPTR,#4500
300B MOVX @DPTR,A
300C SJMP 300C

SAMPLE INPUT AND OUTPUT

INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
XOR LOGIC:
ADDRES
S LABEL MNEMONICS
3000 MOV A,#02
3002 MOV B,#04
3005 XRL A,B
3007 MOV DPTR,#4500
300A MOVX @DPTR,A
300B SJMP 3009

SAMPLE INPUT AND OUTPUT

INPUT OUTPUT
ADDRESS DATA ADDRESS DATA

CONCLUSION:

1’S COMPLEMENT AND 2’S COMPLEMENT


EX NO:

DATE:

OBJECTIVE:
To write an Assembly Language Program (ALP) to perform two’s complement
of a number using 8051 micro controller.

COMPONENTS REQUIRED:

S.NO COMPONENTS SPECIFICATION QUANTITY


1. Microcontroller kit 8051 kit 1
2. Power Supply +5 V dc 1
3. Key board - 1

ALGORITHM:

STEP 1: Start the program.

STEP 2: Get the input data’s and stored it in registers.

STEP 3: Complement the input data and then add with 01.

STEP 4: Perform addition operation with input and complemented one.

STEP 5: Stop the program

FLOW CHART:
PROGRAM:

ONE”S COMPLEMENT:

ADDRESS LABEL MNEMONICS


3000 MOV A,#02
3002 CPL A
3003 MOV DPTR,#4500
3006 MOVX @DPTR,A
3007 SJMP 3007

SAMPLE INPUT AND OUTPUT

INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
TWO”S COMPLEMENT:
ADDRESS LABEL MNEMONICS
3000 MOV A,#02
3002 CPL A
3003 INC A
3004 MOV DPTR, #4500
3007 MOVX @DPTR,A
3008 SJMP 300A

SAMPLE INPUT AND OUTPUT

INPUT OUTPUT
ADDRESS DATA ADDRESS DATA

CONCLUSION:

SQUARE AND CUBE OF A NUMBER


EX NO:

DATE:

OBJECTIVE:
To write an Assembly Language Program (ALP) to find square of a number
using 8051 microcontroller.

COMPONENTS REQUIRED:

S.NO COMPONENTS SPECIFICATION QUANTITY


1. Microcontroller kit 8051 kit 1
2. Power Supply +5 V dc 1
3. Key board - 1
ALGORITHM:

STEP 1: Start the program.

STEP 2: Get the input data.

STEP 3: Set the count value.

STEP 4: Add the input data with data 00.

STEP 5: Decrement the count value.

STEP 6: Repeat the process until count equals zero.

STEP 7: Store the CONCLUSION.

STEP 7: Stop the program.

FLOWCHART:
PROGRAM:
SQUARE OF A NUMBER:
ADDRESS LABEL MNEMONICS
3000 MOV A,#02
3002 MOV B,A
3004 MUL AB
3005 MOV DPTR,#4500
3008 MOVX @DPTR,A
3009 SJMP 3009

SAMPLE INPUT AND OUTPUT

INPUT OUTPUT
ADDRESS DATA ADDRESS DATA

CUBE OF A NUMBER:
ALGORITHM:

STEP 1: Start the program.

STEP 2: Get the input data.

STEP 3: Set the count value.

STEP 4: Add the input data with data 00.

STEP 5: Decrement the count value.

STEP 6: Repeat the process until count


equals zero.

STEP 7: Store the CONCLUSION.

STEP 8: Stop the program.

FLOWCHART:
PROGRAM:

ADDRES
S LABEL MNEMONICS
3000 MOV A,#02
3002 MOV B,A
3004 MUL AB
3005 MOV B,A
3007 MOV A,#02
3009 MUL AB
300A MOV DPTR,#4500
300D MOVX @DPTR,A
300F SJMP 300F

SAMPLE INPUT AND OUTPUT

INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
CONCLUSION:

UNPACKED BCD TO ASCII CONVERSION

EX NO:

DATE:

OBJECTIVE:
To write an Assembly Language Program (ALP) to convert UNPACKED BCD
TO ASCII using 8051 microcontroller.

COMPONENTS REQUIRED:

S.NO COMPONENTS SPECIFICATION QUANTITY


1. Microcontroller kit 8051 kit 1
2. Power Supply +5 V dc 1
3. Key board - 1

PROGRAM:

ADDRES
S LABEL MNEMONICS
MOV A,#41H
MOV B,A
SUBB A,#40H
JC LABEL1
MOV A,B
SUBB A,#37H
MOV R0,A
SJMP HERE
 LABEL1 MOV A,B
:
CLR C
SUBB A,#30H
MOV R0,A
HERE: SJMP HERE

CONCLUSION:
ADDITIONAL EXPERIMENTS USING 8086
FINDING THE SUM OF ‘N’ NUMBERS

EX NO:

DATE:

OBJECTIVE:
To write an Assembly Language Program (ALP) to find sum of ‘n’ numbers
using 8086 microprocessor.

COMPONENTS REQUIRED:

S.NO COMPONENTS SPECIFICATION QUANTITY


1. Microprocessor kit 8086 kit 1
2. Power Supply +5 V dc 1
3. Key board - 1

PROGRAM:

ADDRES LABE
S L MNEMONICS
1000 MOV CL,00
1002 MOV DL,00
1004 MOV SI,2000
1007 MOV AL,00
1009 XXX MOV AL,[SI]
100B INC SI
100C JNC YYY
100E INC DI
1010 YYY LOOP XXX
1012 MOV [3000],DL
1016 MOV [3001],AL
101A HLT
SAMPLE INPUT AND OUTPUT

INPUT1 INPUT 2 OUTPUT


ADDRESS DATA ADDRESS DATA ADDRESS DATA
CONCLUSION:

FINDING THE FACTORIAL OF A GIVEN NUMBER

EX NO:

DATE:

OBJECTIVE:
To write an Assembly Language Program (ALP) to find the factorial of a given
number using 8086 microprocessor.

COMPONENTS REQUIRED:

S.NO COMPONENTS SPECIFICATION QUANTITY


1. Microprocessor kit 8086 kit 1
2. Power Supply +5 V dc 1
3. Key board - 1

PROGRAM:

ADDRESS LABEL MNEMONICS


1000 MOV SI,2000
1003 MOV BX,[SI]
1005 MOV AX,0001
1008 XXX MUL BX
100A DEC BX
100B JNZ XXX
100D MOV DI,2050
1010 MOV [DI],AX
1012 HLT
SAMPLE INPUT AND OUTPUT

INPUT1 INPUT 2 OUTPUT


ADDRESS DATA ADDRESS DATA ADDRESS DATA

CONCLUSION:

ONE’S COMPLEMENT AND 2’S COMPLEMENT OF A NUMBER


EX NO:

DATE:

OBJECTIVE:
To write an Assembly Language Program (ALP) to perform 1’s and 2’s
complement using 8086 microprocessor.

COMPONENTS REQUIRED:

S.NO COMPONENTS SPECIFICATION QUANTITY


1. Microprocessor kit 8086 kit 1
2. Power Supply +5 V dc 1
3. Key board - 1

PROGRAM:

ONE’S COMPLEMENT OF A NUMBER:

ADDRESS LABEL MNEMONICS


1000 MOV SI,0500
1003 MOV DI,0600
1006 MOV CX,0002
1009 XXX LODSB
100A NEG AL
100C DEC AL
100E STOSB
100F LOOP XXX
1011 HLT

TWO’S COMPLEMENT OF A NUMBER:

ADDRESS LABEL MNEMONICS


1000 MOV SI,0500
1003 MOV DI,0600
1006 MOV CX,0002
1009 XXX LODSB
100A DEC AL
100C STOSB
100F LOOP XXX
1011 HLT

SAMPLE INPUT AND OUTPUT


ONE’S COMPLEMENT OF A NUMBER:

INPUT1 INPUT 2 OUTPUT


ADDRESS DATA ADDRESS DATA ADDRESS DATA
SAMPLE INPUT AND OUTPUT
TWO’S COMPLEMENT OF A NUMBER:
INPUT1 INPUT 2 OUTPUT
ADDRESS DATA ADDRESS DATA ADDRESS DATA

CONCLUSION:

PALINDROME CHECKING

EX NO:

DATE:

OBJECTIVE:
To write an Assembly Language Program (ALP) to check whether the given
string is palindrome or not using 8086 microprocessor.

COMPONENTS REQUIRED:

S.NO COMPONENTS SPECIFICATION QUANTITY


1. Microprocessor kit 8086 kit 1
2. Power Supply +5 V dc 1
3. Key board - 1

PROGRAM:

ADDRE LABE MNEMONIC


SS L S
1000 MOV SI,1200
1003 MOV DI,1304
1006 MOV CL,05
1008 XXX CLD
1009 LODSB
100A STD
100B STOSB
100E LOOP XXX
1014 MOV DL,05
1016 CLD
1018 JNE YYY
101A MOV BL,FF
MOV
101C [4000],BL
1023 YYY MOV BL,00
MOV
1025 [4000],BL
1029 HLT

SAMPLE INPUT AND OUTPUT

INPUT1 INPUT 2 OUTPUT


ADDRESS DATA ADDRESS DATA ADDRESS DATA
CONCLUSION:

GENERATION OF FIBONACCI SERIES

EX NO:

DATE:

OBJECTIVE:
To write an Assembly Language Program (ALP) to generate Fibonacci series
using 8086 microprocessor.

COMPONENTS REQUIRED:

S.NO COMPONENTS SPECIFICATION QUANTITY


1. Microprocessor kit 8086 kit 1
2. Power Supply +5 V dc 1
3. Key board - 1

PROGRAM
ADDRE LABE MNEMONIC
SS L S
MOV SI,1200
MOV CL,[SI]
INC SI
MOV AL,00
MOV [SI],AL
INC SI
INC AL
MOV [SI],AL
SUB CL,02
XXX DEC SI
MOV AL,[SI]
INC SI
MOV BL,[SI]
ADD AL,BL
INC SI
MOV [SI],AL
LOOP XXX
HLT

SAMPLE INPUT AND OUTPUT

INPUT1 INPUT 2 OUTPUT


ADDRESS DATA ADDRESS DATA ADDRESS DATA
CONCLUSION:

BLINKING OF LED SIMULATION

EX NO:

DATE:

OBJECTIVE:
To write an Assembly Language Program (ALP) to simulate LED Blinking.

COMPONENTS REQUIRED:
S.NO COMPONENTS SPECIFICATION QUANTITY
1. Microcontroller kit 8051 kit 1
2. Power Supply +5 V dc 1
3. Key board - 1

PROGRAM
LABE MNEMONIC
ADDRESS L S
1000 MOV SI,[1200]
1003 MOV CL,[SI]
1005 INC SI
1006 MOV AL,00
1008 MOV [SI],AL
100A INC SI
100B INC AL
100E SUB CL,02
1012 XXX DEC SI
1015 INC SI
1016 MOV BL,[SI]
101A INC SI
101B MOV [SI],AL
101D LOOP XXX
101F HLT

CONCLUSIO
N:

You might also like