MP_EXPERIMENTS
MP_EXPERIMENTS
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
Mission
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
3
Experiment No. 1
Aim: Study of 8086 microprocessor kit.
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
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.
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.
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
END
Program:
Mov AL, 05
Mov BL, 04
Add AL, BL
Int 03
7
Program with Opcode:
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.
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
END
Program:
Mov AX, 1234
Mov BX, 4321
Add AX, BX
Int 03
9
Program with opcode:
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.
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
END
Program:
Mov AL, 05
Mov BL, 04
Sub AL, BL
Int 03
11
Program with opcode:
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.
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
END
Program:
Mov AX, 0022
Mov BX, 0011
Add AX, BX
Int 03
13
Program with opcode:
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.
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
END
Program:
Mov AL, 05
Mov BL, 04
Mul AL, BL
Int 03
15
Program with opcode:
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.
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
END
Program:
Mov AL, 05
Mov BL, 04
Div AL, BL
Int 03
17
Program with opcode:
18
Experiment No. 9
Aim: Study of 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.
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.
20
Experiment No. 10
Aim: Write a program using 8051 microcontroller for
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.
Flow chart:
START
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
Flow chart:
START
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