0% found this document useful (0 votes)
7 views

MP_EXPERIMENTS

The document is a lab manual for the Microprocessor and Interfacing course at Ujjain Engineering College, detailing the vision and mission of the Computer Science and Engineering department. It outlines various experiments involving the 8086 microprocessor and 8051 microcontroller, including programming tasks such as addition, subtraction, multiplication, and division of numbers. Each experiment includes objectives, apparatus, algorithms, and sample programs with opcodes.

Uploaded by

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

MP_EXPERIMENTS

The document is a lab manual for the Microprocessor and Interfacing course at Ujjain Engineering College, detailing the vision and mission of the Computer Science and Engineering department. It outlines various experiments involving the 8086 microprocessor and 8051 microcontroller, including programming tasks such as addition, subtraction, multiplication, and division of numbers. Each experiment includes objectives, apparatus, algorithms, and sample programs with opcodes.

Uploaded by

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

MICROPROCESSOR AND INTERFACING

LAB MANUAL

B.E. V SEMESTER

Department Of Computer
Science and Engineering
Ujjain Engineering College, Ujjain
Indore Road, Ujjain, Madhya Pradesh 456010

Name & Signature of the faculty Name & Signature of the HOD

1
Computer Science and Engineering

Vision

To impart quality technical education in the field of Computer Science and


Engineering to our students enabling them become competent professionals.

Mission

To develop an environment by adopting interactive teaching learning


methodologies with a focus on:

M1. Providing Quality education through collaboration with premier


Institutes.

M2. Developing skills in latest technology focusing on both theoretical and


practical aspects.

M3. Inspiring graduates for higher education, research and development.

M4. Promote research based projects in the emerging areas of technology


convergence.

2
UJJAIN ENGINEERING COLLEGE, UJJAIN
Indore Road, Ujjain Madhya Pradesh, 456010
Department of Computer Science and Engineering

Name of the Subject & Code : MICROPROCESSOR AND INTERFACING LAB (CS-5008)
Name of the faculty Member : Miss. Payal Parmar
Semester : Vth Semester

Sr. Date Covered Remark


NAME OF EXPERIMENT
no.
1 Study of 8086 microprocessor kit.
2 Write down the steps to execute a program in 8086 trainer kit.
3 Write a program using 8086 to perform addition of two 8-bit
numbers using immediate addressing mode.
4 Write a program using 8086 to perform addition of two 16-bit
numbers using immediate addressing mode.
5 Write a program using 8086 to perform subtraction of two 8-
bit numbers using immediate addressing mode.
6 Write a program using 8086 to perform subtraction of two 16-
bit numbers using immediate addressing mode.
7 Write a program using 8086 to perform multiplication of two
8-bit numbers using immediate addressing mode.
8 Write a program using 8086 to perform division of two 8-bit
numbers using immediate addressing mode.
9 Study of 8051 microcontroller trainer kit.
10 Write a program using 8051 microcontroller for
10.1 Addition of two 8-bits numbers (with carry).
10.2 Subtraction of two 8-bit numbers.

3
Experiment No. 1
Aim: Study of 8086 microprocessor kit.

Apparatus: 8086 microprocessor kit.

Theory: Intel 8086 high performance CPU operating at 8 MHz speed.

Memory: Monitor Firmware in two 27256 EPROMz is placed in the highest 64 KB bank (F0000H to
FFFFFH). 64KB static RAM with powerful battery backup is provided in the address range 00000 to 0FFFFH.

Hexpad/Display interface: 8279 keyboard display controller is used for Hexpad keys & displays (8nos. of
7 segment displays)

Serial Interface: Serial interface is available through a RS-232 compatible port. 8251 USART along with
1488, 1489 driver chips provides necessary signals for this interface. The signals are brought out on the 9 pin D-
type male connector (J5). Baud rates from 300 to 9600 can be selected through software.

Timer: Three channels of 16 bit Timer/Counter are provided using 8253. CHANNEL 0 is used for Baud rate
generation. CH1 and CH2 signals are brought out on a 7 pin Relimate connector and can be used by the user.

Interrupt Controller: The 8259 interrupt controller provides 8 prioritized interrupt levels. IRQ5 to IRQ7
are brought out on 50 pin FRC connector and can be used by the user. IRQ3 is connected to “INT” key of Hex
keypad. 8259 is programmed for edge trigger. Except IRQ3 all other interrupts are masked.

Parallel I/O Interface: Two 8255’s are present onboard, out of which 1 is used for DYNA-PIO cards and 1
for printer interface. All the 48 lines of 8255’s are available to the user and are brought out on the two numbers
of 26 pin FRC male connectors.

System Software: The 8086 Microprocessor kit has vast software features. It supports two different modes
of operation:
1. HEX KEYPAD mode
2. SERIAL mode

Power Supply: The power requirement of 8086 board is:


+5 V 3 Amps
+12V 250 mA
-12V 250 mA

Serial Connector: All the signals for the RS 232C compatible serial interface are brought out on the 9-pin D
type Male (DTM) connector onboard. The serial cables can be directly connected to this connector.

Relimate Connector for TIMER: A 7-pin Relimate connector is provided, which has timer interface
lines terminated on it. It can be used for user applications.

FRC for 8255 I/O interface: Two 26 pin FRC male connectors are provided onboard for 8255’s I/O interface.
The 3 ports, 8 bit each, 24 lines of each, 8255 are provided on this connector. Connector J2 is used for
interfacing DYNA-PIO cards whereas J1 is used to connect printer in serial mode.
4
FRC for Buffered Bus:
A 50 pin FRC male connector provided is for Bus expansion purpose. All the address, Data and control lines
along with the DRQ & interrupts are terminated on this connector (J7).

5
Experiment No. 2
Aim: Write down the steps to execute a program in 8086 trainer kit.

Apparatus: 8086 trainer kit.

Steps:
1. Power on the trainer.
2. A message display on the display of the kit “8086”.
3. Now, first press “Next button”.
4. Now press “EB/AX” key and put starting address of your program. By default, RAM starting address started
from “0400H”.
5. Now enter first opcode of your program and press “CRT NEXT” and the memory location automatically
increment.
6. Now just enter next data of your program and continue the process till the last byte of program.
7. After entering last byte of program, press “TTY” key from keyboard.
8. A “.” on display indicate the data is successfully entered in RAM.
9. Now to execute program press “GO/CX” key from keyboard.
10. On display some memory location and data is displayed.
11. Just entered the starting address of program and after that press “TTY” key from keyboard.
12. A message “E” will be displayed on display.
13. It indicates that program is executing.
14. To examine result observe the memory location where the data is manipulated.

6
Experiment No. 3
Aim: Write a program using 8086 to perform addition of two 8-bit numbers using
immediate addressing mode.

Apparatus: 8086 trainer kit.

Algorithm:
1. Initialize the pointer to the memory for data and result.
2. Load the data into AL and BL registers.
3. Add the two data of BL and AL registers.
4. Store the result into memory ie to AL register.

Flow Chart:

START

Initialize the memory pointer

Load the data to AL and BL


registers

Add two data of AL and BL


registers

Store the result

END

Program:
Mov AL, 05
Mov BL, 04
Add AL, BL
Int 03
7
Program with Opcode:

Memory Opcode Mnemonics Comment


Address
2000 B0 05 Mov AL, 05 Data 05 is stored in reg. AL
2002 B3 04 Mov BL,04 Data 04 is stored in reg. BL
2004 02 C3 Add AL, BL Data of AL and BL are added
and stored in AL
2006 CC Int 03 Stop

Input: First 8-bit number is 05


Second 8-bit number is 04

Output: AL:-09
Addition of two 8-bit numbers is 09

8
Experiment No. 4
Aim: Write a program using 8086 to perform addition of two 16-bit numbers using
immediate addressing mode.

Apparatus: 8086 trainer kit.

Algorithm:
1. Initialize the pointer to the memory for data and result.
2. Load the data into AX and BX registers.
3. Add the two data of BX and AX registers.
4. Store the result into memory ie. to AX register.

Flow Chart:

START

Initialize the memory pointer

Load the data to AX and BX


registers

Add two data of AX and BX


registers

Store the result

END

Program:
Mov AX, 1234
Mov BX, 4321
Add AX, BX
Int 03

9
Program with opcode:

Memory Opcode Mnemonics Comment


Address
200 B8 34 12 Mov AX, 1234 Move the first 16-bit data in
AX register
203 BB 21 43 Mov BX,4321 Move the second 16-bit data
in BX register
206 01 D8 Add AX, BX Addition of two 16-bit
numbers
208 CC Int 03 Stop

Input: First 16-bit number is 1234.


Second 16-bit number is 4321.

Output: AX:-5555
Addition of two 16-bit numbers is 5555.

10
Experiment No. 5
Aim: Write a program using 8086 to perform subtraction of two 8-bit numbers using
immediate addressing mode.

Apparatus: 8086 trainer kit.

Algorithm:
1. Initialize the pointer to the memory for data and result.
2. Load the data into AL and BL registers.
3. Subtract the two data of BL and AL registers.
4. Store the result into memory ie. to AL register.

Flow Chart:

START

Initialize the memory pointer

Load the data to AL and BL


registers

Subtract two data of AL and BL


registers

Store the result

END

Program:
Mov AL, 05
Mov BL, 04
Sub AL, BL
Int 03

11
Program with opcode:

Memory Opcode Mnemonics Comment


Address
2000 B0 05 Mov AL, 05 Data 05 is stored in reg. AL
2002 B3 04 Mov BL,04 Data 04 is stored in reg. BL
2004 2B C3 Sub AL, BL Data of AL and BL are
subtract and stored in AL
2006 CC Int 03 Stop

Input: First 8-bit number is 05.


Second 8-bit number is 04.

Output: AL:-01
Subtraction of two 8-bit numbers is 01.

12
Experiment No. 6
Aim: Write a program using 8086 to perform subtraction of two 16-bit numbers using
immediate addressing mode.

Apparatus: 8086 trainer kit.

Algorithm:
1. Initialize the pointer to the memory for data and result.
2. Load the data into AX and BX registers.
3. Subtract the two data of BX and AX registers.
4. Store the result into memory ie. to AX register.

Flow Chart:

START

Initialize the memory pointer

Load the data to AX and BX


registers

Subtract two data of AX and BX


registers

Store the result

END

Program:
Mov AX, 0022
Mov BX, 0011
Add AX, BX
Int 03

13
Program with opcode:

Memory Opcode Mnemonics Comment


Address
200 B8 22 00 Mov AX, 0022 Move the first 16-bit data in
AX register
203 BB 11 00 Mov BX,0011 Move the second 16-bit data
in BX register
206 29 D8 Sub AX, BX Subtraction of two 16-bit
numbers
208 CC Int 03 Stop

Input: First 16-bit number is 0022.


Second 16-bit number is 0011.

Output: AX:-0011
Subtraction of two 16-bit numbers is 0011.

14
Experiment No. 7
Aim: Write a program using 8086 to perform multiplication of two 8-bit numbers using
immediate addressing mode.

Apparatus: 8086 trainer kit.

Algorithm:
1. Initialize the pointer to the memory for data and result.
2. Load the data into AL and BL registers.
3. Multiply the two data of BL and AL registers.
4. Store the result into memory ie. to AL register.

Flow Chart:

START

Initialize the memory pointer

Load the data to AL and BL


registers

Multiply two data of AL and BL


registers

Store the result

END

Program:
Mov AL, 05
Mov BL, 04
Mul AL, BL
Int 03

15
Program with opcode:

Memory Opcode Mnemonics Comment


Address
2000 B0 05 Mov AL, 05 Data 05 is stored in reg. AL
2002 B3 04 Mov BL,04 Data 04 is stored in reg. BL
2004 F7 E3 Mul AL, BL Data of AL and BL are
multiplied and stored in AL
2006 CC Int 03 Stop

Input: First 8-bit number is 05.


Second 8-bit number is 04.

Output: AL:-20
Multiplication of two 8-bit numbers is 20.

16
Experiment No. 8
Aim: Write a program using 8086 to perform division of two 8-bit numbers using
immediate addressing mode.

Apparatus: 8086 trainer kit.

Algorithm:
1. Initialize the pointer to the memory for data and result.
2. Load the data into AL and BL registers.
3. Divide the two data of BL and AL registers.
4. Store the result into memory ie. to AL register.

Flow Chart:

START

Initialize the memory pointer

Load the data to AL and BL


registers

Divide two data of AL and BL


registers

Store the result

END

Program:
Mov AL, 05
Mov BL, 04
Div AL, BL
Int 03

17
Program with opcode:

Memory Opcode Mnemonics Comment


Address
2000 B0 05 Mov AL, 05 Data 05 is stored in reg. AL
2002 B3 04 Mov BL,04 Data 04 is stored in reg. BL
2004 F6 F3 Div AL, BL Data of AL is divided by BL
and result stored in AL
2006 CC Int 03 Stop

Input: First 8-bit number is 05.


Second 8-bit number is 04.

Output: AL:-01 (Remainder)


AH:-01 (Quotient)

18
Experiment No. 9
Aim: Study of 8051 microcontroller trainer kit.

Apparatus: 8051 microcontroller trainer kit.

Theory: Intel 8051 Microcontroller operates at 11.0592 MHZ. The board can operate using the 101/104 PC
keyboard supplied along with the trainer kit and 2 line by 16 characters LCD display or from the PC (using the
Terminal Emulation Software). 8051 is equipped with powerful software monitor in 27C256 EPROM. The
board has 32KB CMOS static RAM (type 62256). 8051 works on +9V DC at 1 Amp.

The 8051 board has the following hardware features:

• 8051 Microcontroller operating at 11.0592MHZ.


• 32KB powerful software monitor in 27C256 EPROM.
• 64KB on chip Flash memory (partially used by Firmware).
• Two 16 – bit programmable on chip Timer.
• 30 Programmable I/O pins (24 from 8255 and 6 (P1.0 to P1.5) from Port 1 of 8051).
• 50 pin FRC connector for system bus expansion.
• 20 pin FRC connector for user interface from 8255.
• 9 pin D type connector for RS 232C interface.
• Six different selectable baud rates from 150 to 9600.
• One timer and external interrupt.
• 101 PC type keyboard for entering user address/data and for commands.
• Built in line – by – line Assemble and Disassemble.
• Facility to connect to PC.

SYSTEM DESCRIPTION

1. Memory: Firmware is stored in 27C256 EPROM. User data/program can be stored in 32KB COMS static
RAM of type 62256. The board uses an 8255 totally available to the user.

2. LCD Display interface: 2X16 character LCD display is directly connected to the bus like a memory device.

3. Serial Interface: Serial communication is achieved using 8051. This is possible when the Microcontroller
is operating in alternate mode. In this mode, port pins 3.0 and 3.1 act as receive and transmit pins respectively.

4. Timer : 8051 has built in 16 bit counter/timer called timer 0 and 1. Timer 1 is used internally by the system
for generating the baud clock. Timer 0 is free and hence can be used by the user.

19
Connector details

1. 50 pin expansion connector: The 50 Pin FRC connector is used to interconnect with the Interface cards like
8255, 8279, 8253/8251, 8259, 8257. And the 50 Pin FRC connector is provided for bus expansion purpose.

2. 20 pin expansion connectors: The 20 Pin FRC connector is used to interconnect with the Interface cards
like ADC, DAC, SWITCH/LED, RELAY buzzer Interfaces etc.

3. Keyboard connector

4. 9pin ‘d’ type (female): Serial interface are brought out on the 9 pin D type male connector. The serial cable
can be directly connected to this connector.

Power supply: Trainer kit will work at 0 – 9v (1 amp) from the PS power supply. The 6 pin female connector
can be plugged in 6 pin male connector soldered on board.

Keyboard details: 101 PC type keyboard is interfaced to Microcontroller through its port pin. Communication
between keyboard and Microcontroller takes place using 2 wires – one for serial clock and serial data (P1.6 and
P1.7).

Reset: This key is located in the main PS board. On depressing this key the program starts executing from the
beginning i.e. at reset address 0000. On power on reset message 8051 is displayed in local LCD display.

Registers: 8051 has the following register:

• A or Accumulator used for all logical and arithmetical operations.


• B register (8 bit) used in multiply/divides instructions only.
• R0, R1, R2, R3, R4, R5, R6, and R7 register are general-purpose registers.
• Program counter is 16 bit register capable of addressing from 0000-FFFF
• Stack pointer is an 8-bit register. Stack uses only internal 128 bytes of memory.
• Status/Flag register keeps track of flags.

20
Experiment No. 10
Aim: Write a program using 8051 microcontroller for

a. Addition of two 8-bits numbers (with carry).


b. Subtraction of two 8-bit numbers.

Apparatus: 8051 microcontroller trainer kit and keyboard

Procedure:
1. Switch ON the microcontroller kit.
2. Connect the keyboard (PS/2 or USB A-type)
3. Start entering the program from memory location 9000H either in mnemonics or in opcode.
4. Once finished each instruction, press “enter” button.
5. Execute the program, press “enter” button twice.
6. Verify the result in the address 9100H and also in n accumulator.
7. Repeat the experiment for different values.

a. Addition of two 8-bits numbers (with carry)

Flow chart:

START

Set carry flag

Give input data into


accumulator A

Give next input data into


Register R1

Add accumulator A with


register R1

Store the result

END

21
Program:
Memory Opcode Mnemonics Comment
Address
9000 D3 SETB C Set the carry flag
9001 74 22 MOV A,#22H Given input value
9003 79 44 MOV R1,#44H Given input value
9005 39 ADDC A,R1 A=A+R1+C
9006 90 91 00 MOV DPTR,#9100H
9009 F0 MOVX @DPTR,A Store the result in memory
address 9100
900A 12 00 BB LCALL 00BBH Break point

Result: A=66H
R=44H
9100H=66H

b. Subtraction of two 8-bit numbers

Flow chart:

START

Set carry flag

Give input data into


accumulator A

Give next input data into


Register R1

Subtract the content of


accumulator A by register R1

Store the result

END

22
Program:
Memory Opcode Mnemonics Comment
Address
9000 C3 CLRC clear the carry flag
9001 74 88 MOV A,#88H Given input value
9003 79 33 MOV R1,#33H Given input value
9005 99 SUBB A,R1 A=A-R1
9006 90 91 00 MOV DPTR,#9100H
9009 F0 MOVX @DPTR,A Store the result in memory
address 9100
900A 12 00 BB LCALL 00BBH Break point

Result: A=55H
R=33H
9100H=55H

23

You might also like