Download - lab manual for microprocessor
-
7/30/2019 lab manual for microprocessor
1/34
SSN COLLEGE OF ENGINEERING
DEPARTMENT OF ELECTRICAL & ELECTRONICS
ENGINEERING
LAB MANUAL
EE 2356 MICROPROCESSOR & MICRO CONTROLLER
LABORATORY
DEC 2011-APRIL 2012
-
7/30/2019 lab manual for microprocessor
2/34
Expt.No. Name of the experiment1 8 bit and 16 bit Arithmetic operations using 8085 Microprocessor
2 Sorting of numbers (Ascending & descending) using 8085 Microprocessor.
3 Number Conversion(BCD to Hex and Hex to BCD)
4 Arithmetic Operations using 8086 Microprocessor
5 Interfacing 8 bit ADC Converter with 8085 Microprocessor.
6 Interfacing 8 bit DAC Converter with 8085 Microprocessor.
7 Traffic Light controller using 8085 Microprocessor.
8 a Square Wave Generation using 8254
8b Serial Data Transmission using 8251
9 Interfacing 8279 with 8085 microprocessor
10 a
10 b
8 bit Arithmetic operations using 8051 Microcontroller.
Finding the smallest and largest number in an array of numbers using 8051
Microcontroller
11 Interfacing 8 bit DAC Converter with 8051 Microcontroller
12 Interfacing of Stepper Motor with 8051 Microcontroller
-
7/30/2019 lab manual for microprocessor
3/34
EXPT NO 1 a ARITHMETIC OPERATIONS USING 8085
AIM:
To write the assembly language programs for performing the followingarithmetic operations:
a) 16 bit binary addition.
b) 16 bit binary subtraction.
c) 16 bit binary multiplication.
d) 16 bit binary division.
APPARATUS REQUIRED:
Microprocessor kit, Power supply.
PROBLEM STATEMENT:
Write an ALP in 8085 P to add and subtract two 16-bit binary numbers stored
in the memory locations 4100 & 4101 and 4102 & 4103 and store the result starting
from the memory location 4105H. Also provide an instruction in the above program to
observe the carry also and store the carry in the memory location 4104H.
ALGORITHM:
16 BIT ADDITION:
1 Start.
1. Enter the two 16 bit data in two register pairs HL and DE.
2. Initialize a carry counter register B to zero.
3. Add the contents of register pairs.
4. If a carry is generated, increment the carry counter B.
5. Store the Carry in the B register and the sum, which is in the register pair HL in
the memory.
6. Stop.
-
7/30/2019 lab manual for microprocessor
4/34
16 BIT SUBTRACTION:
1. Start.
2. Get the two 16 bit data in two of the register pairs.
3. Subtract the Low Order Byte of data1 from that of the data 2.
4. Subtract the How Order Byte of data1 along with borrow from that of the data2.
5. Store the result in memory.
6. Stop.
PROBLEM STATEMENT:
Write an ALP in 8085 P to multiply two 16-bit binary numbers stored in the
memory locations 4100(LOB) & 4101(HOB) and 4102(LOB) & 4103(HOB) and store
the result in the memory location 4104H & 4105H.Write instructions for performing
16-bit division also.
16 BIT MULTIPLICATION.
1. Start.
2. Initialize BC register pair to store the Carry.
3. Store the data 1 and data 2 in DE register pair and SP register.
4. Initialize the HL register pair to zero, to store the result.
5. Multiply by repeated addition of data 1 data 2 times.
6. If carry flag is set during addition., increment the carry register pair.
7. Store the product available in HL pair in memory.
8. Store the contents of the BC register pair which is the carry in memory.
9. Stop.
16 - BIT DIVISION
1. Start.
1. Store the dividend in HL register pair.
2. Store the divisor in BC register pair
3. Initialize the DE register pair to zero, to carry the quotient.
4. Perform repeated subtraction of divisor from dividend till the dividend is less
than the divisor.
5. For every subtraction done, keep on incrementing the quotient register pair DE.
6. Store the remainder pair in memory.
-
7/30/2019 lab manual for microprocessor
5/34
7. Store the quotient in memory.
8. Stop.
FLOW CHART
16-BIT ADDITION 16-BIT SUBTRACTION
START
INITIALISE
CARRY REGISTER
LOAD TWO NOS. IN
REGISTER PAIRS
ADD THE TWO
NUMBERS
ANY
CARRY
INCREMENT
CARRY
REGISTER
STORE THERESULT
STOP
NO
YES
START
LOAD THE TWO
NUMBERS
INTIALIZE BORROW
REGISTER
SUBTRACT THE
TWO NUMBERS
ANY
BORROW?
INCREMENTCARRY
REGISTER
STORE THE
RESULT
STOP
NO
YES
-
7/30/2019 lab manual for microprocessor
6/34
16-BIT MULTIPLICATION 16-BIT DIVISION
START
GET MULTIPLIER AND
MULTIPLICAND IN
REGISTER PAIRS
PRODUCT=0000
REG. PAIR = REG. PAIR +
MULTIPLICAND
MULTIPLIER =
MULTIPLIER 1
IS MULTIPLIER
= 0?
NO
STORE REGISTER
PAIR
YES
STOP
START
LOAD DIVISOR &
DIVIDEND
QUOTIENT = 0
DIVIDEND =
DIVIDEND DIVISOR
QUOTIENT =
UOTIENT + 1
IS
DIVIDEND