Documente Academic
Documente Profesional
Documente Cultură
(VI SEMSETER)
Prepared By Approved By
Dr.C.Poonngodi
HOD/ECE
15ME608– MICROPROCESSORS AND MICROCONTROLLERS LABORATORY
LIST OF EXPERIMENTS
Microprocessor (8085)
Microprocessor (8086)
5. Arithmetic Operation - 16-bit
6. Arithmetic Operation - 32-bit
7. String Operations
8. Sorting Algorithm
Interfacing
Microconrtroller (8051)
2
15ME608– MICROPROCESSORS AND MICROCONTROLLERS LABORATORY
3
15ME608– MICROPROCESSORS AND MICROCONTROLLERS LABORATORY
MICROPROCESSOR (8085)
4
15ME608– MICROPROCESSORS AND MICROCONTROLLERS LABORATORY
Exp.No:
Date:
Aim:
To write assembly language programs for 8085 microprocessor to perform the following arithmetic
operations:
(a) 8 bit addition
(b) 8 bit subtraction
(c) 8 bit multiplication and
(d) 8 bit by 8 bit division.
Apparatus Required:
1.8085 Trainer
2. Operation Code sheet
Programs:
Memory
Operation Code Label Mnemonics Comments
Address
4100 MVI D,00
4101
4102 LDA 4200
4103
4104
4105 MOV B,A
4106 LDA 4201
4107
4108
4109 ADD B
5
15ME608– MICROPROCESSORS AND MICROCONTROLLERS LABORATORY
410B
410C
410D INR D
410E LOOP STA 4500
410F
4110
4111 MOV A,D
4112 STA 4501
4113
4114
4115 HLT
Memory
Operation Code Label Mnemonics Comments
Address
4200 MVI D,00
4201
4202 LDA 4250
4203
4204
4205 MOV B,A
4206 LDA 4251
4207
4208
4209 SUB B
420A JNC LOOP
420B
420C
420D DCR D
6
15ME608– MICROPROCESSORS AND MICROCONTROLLERS LABORATORY
Memory
Operation Code Label Mnemonics Comments
Address
4300 MVI C, 00
4301
4302 LDA 4350
4303
4304
4305 MOV B, A
4306 LDA 4351
4307
4308
4309 MOV D,A
430A XRA A
430B Loop 2: ADD B
430C JNC Loop 1
430D
430E
430F INR C
4310 Loop 1: DCR D
4311 JNZ Loop 2
7
15ME608– MICROPROCESSORS AND MICROCONTROLLERS LABORATORY
4312
4313
4314 STA 4352
4315
4316
4317 MOV A,C
4318 STA 4353
4319
431A
431B HLT
Memory
Operation Code Label Mnemonics Comments
Address
4400 LDA 4200
4401
4402
4403 MOV B, A
4404 LDA 4201
4405
4406
4407 MVI C,00
4408
4409 LOOP 2 CMP B
440A JC LOOP1
440B
440C
440D SUB B
440E INR C
440F JMP LOOP2
8
15ME608– MICROPROCESSORS AND MICROCONTROLLERS LABORATORY
4410
4411
4412 LOOP 1 STA 4202
4413
4414
4415 MOV A, C
4416 STA 4203
4417
4418
4419 HLT
Observations:
Addend : LSB:
8-Bit Addition
Augend : MSB:
Subtrahend : LSB :
8-Bit Subtraction
Minuend: MSB:
Multiplicand : LSB :
8-Bit Multiplication
Multiplier : MSB:
Dividend: Quotient:
8-Bit Division
Divisor: Remainder:
Viva Questions:
1. What is microprocessor?
2. Which is the first microprocessor?
3. Define CPU.
4. What is the difference between bit & byte ?
9
15ME608– MICROPROCESSORS AND MICROCONTROLLERS LABORATORY
Result:
Thus assembly language programs are written for 8085 microprocessor to perform the following
arithmetic operations:
(e) 8 bit addition
(f) 8 bit subtraction
(g) 8 bit multiplication and
(h) 8 bit by 8 bit division.
The above programs checked by executing using 8085 trainer.
10
15ME608– MICROPROCESSORS AND MICROCONTROLLERS LABORATORY
Exp.No:
Date:
Aim:
To write assembly language programs for 8085 microprocessor to perform the following arithmetic
operations:
(a) 16 bit addition
(b) 16 bit subtraction
Apparatus Required:
1.8085 Trainer
2. Operation Code sheet
Programs:
Memory
Operation Code Label Mnemonics Comments
Address
4100 LHLD 4000H
4103 XCHG
4104 LHLD 4002H
4107 MOV A, E
4108 ADD L
4109 MOV L,A
410A MOV A, D
410B ADCH
410C MOV H, A
410E SHLD 4004H
4111 HLT
11
15ME608– MICROPROCESSORS AND MICROCONTROLLERS LABORATORY
Memory
Operation Code Label Mnemonics Comments
Address
12
15ME608– MICROPROCESSORS AND MICROCONTROLLERS LABORATORY
Observations:
Addend : LSB:
16 -Bit Addition
Augend : MSB:
Subtrahend : LSB :
16 -Bit Subtraction
Minuend: MSB:
VIVA Questions:
1. What is RET instructions?
2. Specify the matrix format used in the microprocessor
3. What is the purpose of STAX instructions?
4. List the various types of JMP instructions.
5. Give the bit field for CALL instructions.
13
15ME608– MICROPROCESSORS AND MICROCONTROLLERS LABORATORY
Result:
Thus assembly language programs are written for Intel 8085 microprocessor to
perform the following arithmetic operations:
(a) 16 bit addition
(b) 16 bit subtraction
The above programs checked by executing using 8085 trainer.
Maximum and Minimum number
Exp.No:
Date:
Aim:
To write assembly language programs to find the maximum and minimum values from a given
array of numbers using 8085 microprocessor.
14
15ME608– MICROPROCESSORS AND MICROCONTROLLERS LABORATORY
Apparatus Required:
1.8085 Trainer
2. Operation Code sheet
Programs:
Memory
Operation Code Label Mnemonics Comments
Address
4200 LXI H,4250
42001
4202
4203 MOV B,M
4204 INX H
4205 MOV A,M
4206 DCR B
4207 Loop: INX H
4208 CMP M
JNC Loop 1(JC Loop
4209
1)*
420A
420B
420C MOV A,M
420D Loop 1: DCR B
420E JNZ Loop
420F
4210
4211 INX H
4212 MOV M,A
4213 HLT
15
15ME608– MICROPROCESSORS AND MICROCONTROLLERS LABORATORY
Observations:
Result
Program Address & Data Ascending Descending
Order Order
4250 :
4251 :
4252 :
4253 : Maximum Minimum
Maximum / Minimum Value
4254 : Value at Value at
in an Array
4255 : 4258 : 4258 :
4256 :
4257 :
4258 :
Viva Questions:
1. What is mnemonic?
2. What is assembler?
3. Define ALU.
4. Name the general purpose registers used in microprocessor 8085.
Result:
Thus the assembly language programs to find the maximum and minimum values from a
given array of numbers using 8085 was written and executed executed using 8085 trainer.
Aim:
To write an assembly language program for interfacing the Programmable Keyboard and
Display Controller (IC 8279) with 8085 microprocessor.
Apparatus Required:
16
15ME608– MICROPROCESSORS AND MICROCONTROLLERS LABORATORY
1. 8085 Trainer
2. Operation Code sheet
3. Programmable Keyboard and Display Controller (IC 8279) interface board
Programs:
17
15ME608– MICROPROCESSORS AND MICROCONTROLLERS LABORATORY
4518 DCR D
4519 JNZ Loop
451A
451B
451C JMP Start
451D
451E
451F Delay: MVI B.A0
4520
4521 Loop1: MVI C,FF
4522
4523 Loop2: DCR C
4524 JNZ Loop2
4525
4526
4527 DCR B
4528 JNZ Loop1
4529
452A
452B RET
VIVA Questions:
1. How many machine cycles are needed for executing LDA instructions
2. How many t states are needed for executing call instructions
3. How many interrupt signal are placed in 8085
4. Which interrupts has the high priority
5. Which interrupts is a non-mask able interrupt
18
15ME608– MICROPROCESSORS AND MICROCONTROLLERS LABORATORY
Result:
Thus an assembly language program for interfacing the programmable keyboard and display
controller (8279) with 8085 microprocessor was written and executed successfully.
19
15ME608– MICROPROCESSORS AND MICROCONTROLLERS LABORATORY
MICROPROCESSOR (8086)
20
15ME608– MICROPROCESSORS AND MICROCONTROLLERS LABORATORY
Arithmetic Operations
Exp.No:
Date:
Aim:
To write assembly language program to perform simple arithmetic operations, like
Addition, Subtraction, and Multiplication & Division using 8086 Microprocessor.
Apparatus Required:
1. 8086 Microprocessor kit
2. Power Supply Chord
3. Keyboard
Program:
SUB AX, BX
MOV [2000], AX
HLT
(v) Multiplication:
MOV AX, 2A2B
MOV BX, 1260
MUL BX
MOV [1200], AX
MOV [1300], DX
HLT
(vi) Division:
MOV AX, 2A2B
MOV BX, 1260
DIV BX
MOV [1200], AX
MOV [1300], DX
HLT
22
15ME608– MICROPROCESSORS AND MICROCONTROLLERS LABORATORY
Viva questions:
1. What is the difference between min mode and max mode of 8086?
2. What is the difference between near and far procedure?
3. What is the difference between Macro and procedure?
4. What is the difference between instructions RET & IRET?
5. What is the difference between instructions MUL & IMUL?
6. What is the difference between instructions DIV & IDIV?
7. What is difference between shifts and rotate instructions?
8. Which are strings related instructions?
9. Which are addressing modes and their examples in 8086?
10. What does u mean by directives?
Result:
Thus the assembly language program was to perform arithmetic operations using 8086
microprocessor was written and executed successfully.
23
15ME608– MICROPROCESSORS AND MICROCONTROLLERS LABORATORY
String Operation
Exp.No:
Date:
Aim:
To write a assembly language program for performing simple string operation, like to search a
word from a string, to find and replace a word from a string using, to copy a string of data words
from one location to the other using 8086 Microprocessor.
Apparatus Required:
1. 8086 Microprocessor kit
2. Power Supply Chord
3. Keyboard
24
15ME608– MICROPROCESSORS AND MICROCONTROLLERS LABORATORY
INPUT:
LIST: 53H, 15H, 19H, 02H
OUTPUT:
3000 01
25
15ME608– MICROPROCESSORS AND MICROCONTROLLERS LABORATORY
INPUT:
LIST: 53H, 15H, 19H, 02H
OUTPUT:
LIST: 53H, 30H, 19H, 02H
26
15ME608– MICROPROCESSORS AND MICROCONTROLLERS LABORATORY
INPUT: OUTPUT:
2000 48 3000
2001 84 3001
2002 67 3002
2003 90 3003
2004 21 3004
Result:
Thus assembly language program to perform simple string operation, like to search a word
from a string, to find and replace a word from a string using, to copy a string of data words from
one location to the other using 8086 Microprocessor was written and executed successfully.
27
15ME608– MICROPROCESSORS AND MICROCONTROLLERS LABORATORY
Sorting
Exp.No:
Date:
Aim:
To write a assembly language program for sorting the given numbers in ascending and
descending order using 8086 Microprocessor.
Apparatus Required:
1. 8086 Microprocessor kit
2. Power Supply Chord
3. Keyboard
Program:
(i) Ascending:
(ii) Descending:
28
15ME608– MICROPROCESSORS AND MICROCONTROLLERS LABORATORY
CMP AX,[SI]
JG L3
XCHG [SI+2], AX
XCHG [SI],AX
L3: ADD SI,02
LOOP L2
DEC DX
JNZ L1
HLT
Viva questions:
1. What is the size of instruction queue in 8088?
2. Which are the registers present in 8086?
3. What is pipelining in 8086?
4. How many 16 bit registers are available in 8086?
5. Specify addressing modes for any instruction?
6. What is assembler directives?
7. What .model small stands for?
8. What is the supply requirement of 8086?
9. What is the relation between 8086 processor frequency & crystal frequency?
10. Functions of Accumulator or AX register?
29
15ME608– MICROPROCESSORS AND MICROCONTROLLERS LABORATORY
Result:
Thus assembly language program to sort the given numbers in ascending and descending
order using 8086 Microprocessor was written and executed successfully.
30
15ME608– MICROPROCESSORS AND MICROCONTROLLERS LABORATORY
Aim:
To write an assembly language program for interfacing the ADC & DAC with 8086
microprocessor.
Apparatus Required:
1. 8086 Trainer
2. ADC& DAC interface board
Program:
DAC - To Generate the Square Waveform in the DAC
DAC EQU 0C0H
1000H
START:
MOV AL,00H
OUT DAC,AL
CALL DELAY
MOV AL,0FFH
OUT DAC,AL
DELAY
JMP START
DELAY:
L1:MOV CX,05FFH
LOOP L1
RET
CODE ENDS
L2:
OUT DAC, AL
INC AL
JNZ L2
JMP START
DELAY:
MOV CX, 05FFH
L1:
LOOP L1
RET
CODE ENDS
END
ADC : To study the value of digital binary word for a given analog
voltage
ADC : To study the value of digital binary word for a given analog
voltage using SOC pulse
32
15ME608– MICROPROCESSORS AND MICROCONTROLLERS LABORATORY
MOV AL,10H
OUT CHSEL,AL
MOV AL,18H
OUT CHSEL,AL
MOV AL,01H
OUT SOC,AL
MOV AL,00H
OUT SOC,AL
LOOP:
IN AL,EOC
AND AL,01H
CMP AL,01H
JNZ LOOP
IN AL,ADCDATA
MOV SI,STOREDATA
MOV [SI],AL
HLT
Viva questions:
1. What is the Resolution of a 6 bit DAC
2. How many equal intervals are present in a 14-bit D-A converter?
3. Non-linearity in the output of converter is expressed in ---------------
4. List the source of errors in ADC.
5. List the advantages of flash type A/D converter
Result:
33
15ME608– MICROPROCESSORS AND MICROCONTROLLERS LABORATORY
Thus an assembly language program has been written and verified to interface the ADC and
DAC with 8086 microprocessor.
Interface Elevator
Exp.No:
Date:
Aim:
To write an assembly language program for interfacing the elevator with 8086
microprocessor.
Apparatus Required:
1. 8086 Trainer
2. Elevator interface board
Program:
TO MOVE THE LIFT1 TO 4TH FLOOR AND TO GIVE A BEEP.
CALL DELAY
MOV AL,20H ;LIFT1 IN
OUT LIFT1,AL ;SECOND FLOOR AND FLOOR
CALL DELAY
MOV AL,10H ;LIFT IN
OUT LIFT1,AL ;THIRD FLOOR
CALL DELAY
MOV AL,08H ;LIFT1 IN
OUT LIFT1,AL ;FOURTH FLOOR
MOV AL,0BH ;BEEP FOR DOOR
OUT STOU,AL ;OPEN
CALL DELAY
MOV AL,03H ;OPEN DOOR
CC OUT STOU,AL
HLT
DELAY:
MOV CL, 02H;
LOOP1:
MOV BX, 0F9FEH
LOOP:
DEC BX
MOV AL,BL
OR AL,BH
JNZ LOOP
DEC CL
JNZ LOOP1
RET
END
35
15ME608– MICROPROCESSORS AND MICROCONTROLLERS LABORATORY
Viva questions:
1. What are SIM and RIM instructions?
2. What is the difference between Macro and Procedure?
3. How many I/O lines are available on the 82C55A
4. Give examples for Maskable interrupts?
5. What is the position of the Stack Pointer after the PUSH instruction?
Result:
36
15ME608– MICROPROCESSORS AND MICROCONTROLLERS LABORATORY
Thus an assembly language program has been written and verified to interface the elevator
with 8086 microprocessor
MICROCONTROLLER (8051)
37
15ME608– MICROPROCESSORS AND MICROCONTROLLERS LABORATORY
Exp.No:
Date:
Aim:
To write assembly language programs for 8051 microcontroller to perform the following arithmetic
operations:
8 bit addition
8 bit subtraction
8 bit multiplication and
8 bit by 8 bit division
Apparatus Required:
8051 Microcontroller kit
Power Supply Chord
Keyboard
Program:
(i) Addition:
CLR C
MOV A,#data1
ADD A,#data2
MOV DPTR,#4500
MOVX @DPTR,A
HERE: SJMP HERE
(ii) Subtraction
CLR C
MOV A,#data1
SUBB A,#data2
38
15ME608– MICROPROCESSORS AND MICROCONTROLLERS LABORATORY
MOV DPTR,#4500
MOVX @DPTR,A
HERE: SJMP HERE
(iii) Multiplication
CLR C
MOV A,#data1
MOV B,#data2
MUL AB
MOV DPTR,#4500
MOVX @DPTR,A
INC DPTR
MOV A,B
MOVX @DPTR,A
HERE: SJMP HERE
(iv) Division
CLR C
MOV A,#data1
MOV B,#data2
DIV AB
MOV DPTR,#4500
MOVX @DPTR,A
INC DPTR
MOV A,B
MOVX @DPTR,A
HERE: SJMP HERE
Viva Questions:
What is microcontroller?
39
15ME608– MICROPROCESSORS AND MICROCONTROLLERS LABORATORY
Result:
Thus assembly language programs are written for 8051 microcontroller to perform the following
arithmetic operations:
8 bit addition
8 bit subtraction
8 bit multiplication and
8 bit by 8 bit division.
The above programs checked by executing using 8051 trainer.
40