Lab Manual Microprocessor & Microcontroller-B.tech-Eee-5th PDF
Lab Manual Microprocessor & Microcontroller-B.tech-Eee-5th PDF
B.TECH
5TH SEMESTER
2
EXPERIMENT NO: 01
EXAMINING THE CONTENTS OF REGISTERS
AIM: To examine and modify the contents of the registers in 8085 microprocessor kit.
THEORY:
This command is used to examine/modify any internal registers of the CPU. If one wants to examine the
contents of all the registers, one can start from register A and examine all the registers by pressing NEXT
key. Whereas if some specific registers is to be examined, then the key for that register can be entered
directly. The contents of any register can be changed.
PROCEDURE:
To examine the registers.
Step 1: press RESET key before executing program.
Step2: press SHIFT key and then press EXREG key.
Step3: Press registers key and NEXT key simultaneously.
After step 3 follow these steps to modify the contents.
Step1: press any register and change the data and then press NEXT key.
Step2: press ‘.’ Key to terminate.
Step3: press EXREG key and enter the particular register which is changed.
3
FLOW CHART
START
STOP
START
STOP
4
EXPERIMENT NO-02
THEORY:
This command is used to examine the contents of any memory location and modify the contents of the
RAM area. On pressing this key, a dot is displayed in the end of address field. One can now enter the
address of any location one wants to examine. Enter the desired address and press NEXT. The content of
this location is displayed in the data field. If one wants to examine the contents of next location, just
press NEXT and the address in the address field will be incremented by one and its contents will be
displayed in the data field. Same way if one wants to examine the contents of previous location just
press PRE key and the address in the address field will be decremented by one and its contents will be
displayed in the data field.
PROCEDURE
Step 1: Press RESET key.
Step 2: Press EMEM
Step 3: Enter the desired memory address and press NEXT key.
Step 4: data will be displayed in data field.
Step 5: press NEXT key and memory address will be incremented by one and data will be shown.
To modify the data, after step 5 follow these steps
Step 1: change the data
Step 2: Press.’ key.
Step 3: press EXMEM key and enter the memory address which is changed.
5
FLOW CAHRT:
START
Data in the memory address will be shown in data field and press NEXT
STOP
6
EXPERIMENT NO: 03
ADDITION OF TWO 8-BIT NUMBERS AND SUM IS 8-BIT
AIM: Write 8085 assembly language program for addition of two 8-bit numbers.
ALGORITHM
7
FLOW CHART
8
PROGRAM
EXPERIMENTAL RESULTS
9
CALCULATION
1111 1111
1111 1111
FE
RESULT:
The assembly language program for 8 bit addition of two numbers was executed Successfully by using
8085 micro processing kit.
10
EXPERIMENT NO: 04
SUBTRACTION OF TWO 8-BIT NUMBERS
AIM:To write a assembly language program for subtracting 2 bit (8) numbers by using-8085
microprocessor kit.
APPARATUS REQUIRED:
8085 microprocessor kit
(0-5V) DC battery
ALGORITHM:
Step 1 : Start the microprocessor
Step 2 : Intialize the carry as ‘Zero’
Step 3 : Load the first 8 bit data into the accumulator
Step 4 : Copy the contents of contents into the register ‘B’
Step 5 : Load the second 8 bit data into the accumulator.
Step 6 : Subtract the 2 8 bit datas and check for borrow.
Step 7 : Jump on if no borrow
Step 8 : Increment borrow if there is
Step 9 : 2’s compliment of accumulator is found out
Step 10 : Store the result in the accumulator
Step 11 : More the borrow value from ‘c’ to accumulator
Step 12 : Store the borrow value in the accumulator
Step 13 : Stop program execution
11
FLOW CHART START
Check
for carry
NO
YES
STOP
12
PROGRAM
EXPERIMENTAL RESULTS
RESULT:
The assembly language program subtraction of two 8 bit numbers was executed successfully by
using 8085 micro processing kit.
13
EXPERIMENT NO: 05
ADDITION OF TWO 16 – BIT NUMBERS
AIM: To write an assembly language program for adding two 16 bit numbers using 8085
microprocessor kit.
ALGORITHM:
Step 1 : Start the microprocessor
Step 2 : Get the 1st8 bit in ‘C’ register (LSB) and 2nd8 bit in ‘H’ register (MSB) of 16 bit number.
Step 3 : Save the 1st16 bit in ‘DE’ register pair
Step 4 : Similarly get the 2nd16 bit number and store it in ‘HL’ register pair.
Step 5 : Get the lower byte of 1stnumber into ‘L’ register
Step 6 : Add it with lower byte of 2ndnumber
Step 7 : tore the result in ‘L’ register
Step 8 : Get the higher byte of 1stnumber into accumulator
Step 9 : Add it with higher byte of 2ndnumber and carry of the lower bit addition.
Step 10: Store the result in ‘H’ register
Step 11 : Store 16 bit addition value in ‘HL’ register pair
Step 12 : Stop program execution
14
FLOW CHART:
15
PROGRAM:
WITHOUT CARRY
16
CALCULATION: 0000 0100 0000 0001
0000011100000011
0 7 0 3
WITH CARRY
B E 9 5
RESULT:
The assembly language program for addition of two 16 bit numbers was executed using 8085 micro
processing kit.
17
EXPERIMENT NO: 06
SUBTRACTION OF TWO 16 – BIT NUMBERS
AIM: To write an assembly language program for subtracting two 16 bit numbers using
8085 microprocessor kit.
APPARATUS REQUIRED:
8085 microprocessor kit
(0-5V) DC battery
ALGORITHM:
Step 1 : Start the microprocessor
Step 2 : Get the 1st 16 bit in ‘HL’ register pair
Step 3 : Save the 1st 16 bit in ‘DE’ register pair
Step 4 : Get the 2nd 16 bit number in ‘HL’ register pair
Step 5 : Get the lower byte of 1st number
Step 6 : Get the subtracted value of 2nd number of lower byte by subtracting it with lower byte of 1st
number
Step 7 : Store the result in ‘L’ register
Step 8 : Get the higher byte of 2nd number
Step 9 : Subtract the higher byte of 1st number from 2nd number with borrow
Step 10 : Store the result in ‘HL’ register
Step 11 : Stop the program execution
18
FLOW CHART
19
PROGRAM
20
CALCULATION
05 06 - 07 08
05 06 + 07 08
1010 1010
1000 1000
02 02
RESULT:
The assembly language program for subtraction of two 16 bit numbers was executed by using 8085
micro processing kit.
21
EXPERIMENT NO:07
MULTIPLICATION OF TWO 8 – BIT NUMBERS
AIM: To write an assembly language for multiplying two 8 bitnumbers by using 8085 microprocessor kit.
22
FLOW CHART
23
PROGRAM
RESULT:
The assembly language program for multiplication of two 8 bit numbers was executed using 8085 micro
processing kit
24
EXPERIMENT NO: 08
DIVISION OF TWO 8 – BIT NUMBERS
AIM: To write an assembly language program for dividing two 8 bit numbers using microprocessor kit.
ALGORITHM:
25
FLOW CHART
26
PROGRAM
27
1001
0010 – I
------
0111
0010 – II
------
0101
0010 – III
------
0011
0010 – IV
------
0001 – Carry
Quotient - 04
Carry - 01
RESULT:
The assembly language program for division of two 8 bit numbers was executed using
8085 microprocessor kit.
28