Microprocessor Lab Manual-Pages-Deleted
Microprocessor Lab Manual-Pages-Deleted
INDEX
DATE OF
S.NO. NAME OF EXPERIMENT GRADE
EVALUATION
OBJECTIVE:
Write a program to add two hexadecimal & decimal numbers.
APPARATUS REQUIRED: -
DESCRIPTION/ALGORITHM:-
Hexadecimal Addition: The program takes the content of 2009, adds it to 200B & stores the result
back at 200C.
Steps: 1. Initialize HL Reg. pair with address where the first number is lying.
2. Store the number in accumulator.
3. Get the second number.
4. Add the two numbers and store the result in 200B.
5. Go back to Monitor
Let: (2009 H) = 80 H
(200B H) = 15 H
Result = 80 H + 15 H = 95 H
(2009 H) A
A B
(200B H) A
A + B A
A (200C H)
FLOWCHART : -
Start
End
Decimal Addition:
Steps: 1. Initialize HL Reg. pair with address where the first number is lying.
2. Store the number in accumulator.
3. Get the second number.
4. Add the two numbers and store the result in 200B.
5. Go back to Monitor
FLOWCHART:-
Start
End
REULTS:-
Thus the numbers at 2009H and at memory are added.
CONCLUSION:-
Thus the program to add two 8-bit numbers was executed.
PRECAUTION:-
APPARATUS REQUIRED: -
DESCRIPTION/ALGORITHM:-
Hexadecimal Subtraction : The program takes the content of 2009, subtracts it to 200B & stores the
result back at 200C.
Steps:-
1. Initialize HL Reg. pair with address where the first number is lying.
2. Store the number in accumulator.
3. Get the second number.
4. Subtract second no from acc and store the result in 200B.
5. Go back to Monitor
FLOWCHART:-
Start
End
PROGRAM:-
Steps:-
1. Initialize HL Reg. pair with address where the first number is lying.
2. Store the number in accumulator.
3. Get the second number.
4. Subtract second no from acc and store the result in 200B.
5. Adjust the decimal
6. Go back to Monitor
FLOWCHART:-
Start
End
PROGRAM:-
CONCLUSION:-
Thus the subtraction operation is taken out using assembly language.
10
Q.1. Study how to operate the microprocessor in single stepping. It is very useful in debugging.
Q.2. Identify the clock crystal and record its frequency. Calculate the time for opcode fetch.
Q.3. Identify 8255 programmable peripheral enter face. Find out the address of parts from manual.
Q.4. Identify the ROM & RAM and show in the memory map.
Q.1. Write a small program to enter a data to accumulator and move it to all registers.
Q.2. Find out how to read the contents of registers and flags. Read the content of PC, SP.
Q.3. Why DAA instruction is to be written just after ADD instruction.
Q.4. In above program why MOV A,M instruction is used if direct instruction LDA, address is available.
11
APPARATUS REQUIRED: -
DESCRIPTION/ALGORITHM:-
Steps: 1. Initialize HL Reg. pair with address where the first number is lying.
2. Store the number in accumulator.
3. Get the second number.
4. Add the two numbers and store the result in 200B.
5. Go back to Monitor
FLOWCHART:-
Start
End
12
7. Initialize HL Reg. pair with address where the first number is lying.
8. Store the number in accumulator.
9. Get the second number.
10. Subtract second no from acc and store the result in 200B.
11. Adjust the decimal
12. Go back to Monitor
FLOWCHART:-
Start
End
PROGRAM:-
REULTS:-
The BCD numbers at 2009H and memory are added or substracted.
CONCLUSION:-
Thus the substracttion operation is taken out using assembly language.
13
3. Write a program to exchange the contents of memory location 1000H and 2000H.
4. Why AD0 – AD7 lines are multiplexed ?
5. Give the difference between machine language, assembly language and high level language.
14
Is Carry?
Yes
Increment D register No
No
Is zero?
If Yes
15 END
REULTS:-
Input: FF (4150)
FF (4151)
Output: 01 (4152)
FE (4153)
CONCLUSION:-
Thus the multiplication process is taken out using assembly language for 8085 microprocessor
16
OBJECTIVE: - Write a program to perform multiplication of two 8 bit numbers using bit rotation method
APPARATUS REQUIRED: -
DESCRIPTION/ALGORITHM:-
1) Start the program by loading HL register pair with address of memory location.
2) Move the data to a register (E register).
3) Get the second data and load into Accumulator.
4) Add the two register contents.
5) Check for carry.
6) Increment the value of carry.
7) Check whether repeated addition is over and store the value of product and carry in memory location.
8) Terminate the program.
EXAMPLE :
B7 B6 B5 B4 B3 B2 B1 B0 CY B3 B2 B1 B0
0 0 0 0 0 0 0 0 0 0 1 0 1 Initial Stage
Step 1 0 0 0 0 0 0 0 0 0 1 0 1 0 Shift left by 1
0 0 0 0 0 0 0 0 0 1 0 1 0 Don’t add since CY= 0
Step 2 0 0 0 0 0 0 0 0 1 0 1 0 0 Shift
0 0 0 0 1 1 0 0 1 0 1 0 0 Add multiplicand;CY=1
Step 3 0 0 0 1 1 0 0 0 0 1 0 0 0 Shift left by 1
0 0 0 1 1 0 0 0 0 1 0 0 0 Don’t add since CY= 0
Step 4 0 0 1 1 0 0 0 0 1 0 0 0 0 Add multiplicand;CY=1
PROGRAM:
REULTS:-
Multiplication has been carried out between the data of 2200H and 2201 H.
CONCLUSION:-
Thus the multiplication process for 8 bit binary numbers is taken out in 8085 microprocessor
18
OBJECTIVE:- To interface Programmable Interval timer to 8085 and verify the operation of 8253 in
six different modes
APPARATUS REQUIRED: -
DESCRIPTION/ALGORITHM:-
At first let us see the channel in mode0. Connect the CLK0 to the debounce circuit and execute the
following program.
Program:
MVI A, 30H
OUT CEH
MVI A, 05H
OUT C8H
MVI A, 00H
OUT C8H
HLT
After loading the count, the output will remain low following the rising edge of the gate input.The
output will go high on the terminal count.
The program initializes channel 0 of 8253 in Mode 1 and also initializes triggering of gate.
Program:
MVI A, 32H
OUT CEH
MVI A, 05H
OUT C8H
MVI A,00H
OUT C8H
OUT DOH
HLT
26
MVI A, 36H
OUT CEH
MVI A, 0AH
OUT C8H
MVI A, 00H
OUT C8H
HLT
RESULT:
Thus the 8253 PIT was interfaced to 8085 and the operations for mode 0, 1 and 3 were verified.
27