Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

WORKSHEET – 1.

Name: Kshitiz
Section/Group: 717 / “A”
UID: 20BCS7311
Subject: Microprocessor and Interfacing Lab
Date of Submission: 02.03.2022
Branch: BE CSE (4th Semester)

Aim:
SUBTRACTION of 8 bit and 16 bit numbers using 8085.

Apparatus / Simulator Used:


1. Jubin Application
2. 8085 Simulator
3. JDK

CHANDIGARH UNIVERSITY MICROPROCESSOR AND INTERFACING LAB


Algorithm / Flowchart:
1. To Subtract 8-Bit numbers
//1 Load 3001H contents immediately in H register
// 2 Move the contents of memory to accumulator
// 3 Increment H
// 4 Subtract the content of memory from accumulator
// 5 Increment H
// 6 Move the result from accumulator to provided memory location(3002H)
// 7 Stop

2. To Subtract 16-Bit numbers

//1 load 3010 location content into HL pair


//2 exchange HL content with DE pair
//3 load 3012 location content into HL pair
//4 mov 00H immediately to c reg
//5 move E reg content to accum
//6 subtract the content of L reg from accum
//7 store the result of accum on 3014 memory location
//8 move D reg content to accum
//9 subtract the content of H reg from accum
//10 store the result of accum on 3015 memory location
Code:
 To Subtract 8-Bit numbers
#BEGIN 0000H
LXI H,3001
MOV A,M
INX H
SUB M
INX H
MOV M,A
HLT

#ORG 3001
#DB 35H,15H

 To Subtract 16-Bit numbers

#BEGIN 0000H
LHLD 3010
XCHG
LHLD 3012
MVI C,00
MOV A,E
SUB L
STA 3014
MOV A,D
SBB H

STA 3015

#ORG 3010
#DB 16H,5AH,10H,3AH
Result / Output / Writing Summary

 For 8-Bit numbers


CHANDIGARH UNIVERSITY MICROPROCESSOR AND INTERFACING LAB
For 16-Bit numbers
Learning Outcomes:
1. Working of microprocessors.
2. Learn how to do mathematical operations in microprocessors.
3. Learn about 8085 simulator.
4. Operations of 16 bit numbers.
5. Learn about the different instructions that are needed to be given to the
memory to perform some tasks.
6. Learnt How to subtract using 8085.
CHANDIGARH UNIVERSITY MICROPROCESSOR AND INTERFACING LAB

Evaluation Grid (To be created as per the SOP and Assessment


guidelines by the faculty):

Sr. Parameters Marks Obtained Maximum Marks


No.
1.
2.
3.
CHANDIGARH UNIVERSITY MICROPROCESSOR AND INTERFACING LAB

You might also like