0% found this document useful (0 votes)
33 views

Microprocessor 8085 Appendix A

The document describes subtracting two bytes stored at memory locations D000H and D001H in an 8085 microprocessor. It provides the algorithm, flowchart, and program instructions to: 1) load the first number from D000H into the accumulator, 2) load the second number from D001H and subtract it from the accumulator, 3) store the result at memory location D002H.

Uploaded by

manpreet kaur
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views

Microprocessor 8085 Appendix A

The document describes subtracting two bytes stored at memory locations D000H and D001H in an 8085 microprocessor. It provides the algorithm, flowchart, and program instructions to: 1) load the first number from D000H into the accumulator, 2) load the second number from D001H and subtract it from the accumulator, 3) store the result at memory location D002H.

Uploaded by

manpreet kaur
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 1

Microprocessor 8085

Appendix A

Explanation :

We are given two numbers at memory locations D000 H and D001 H. Let these numbers be
50 H and 20 H.
We have to subtract the byte at memory location D000 H (50 H) with the byte at memory location
D000 H (20 H).
Initially we will store the first number in the accumulator.
Using SUB instruction subtract the two contents. Result of subtraction will be stored in the
A register.
Store the result at memory location D002 H.
For example :
D000 H = 50 H
50 H
D001 H = 20 H

20 H
30 H

Algorithm :

Step I

: Start

Step II : Get the first number in A register.


Step III : Get the second number in memory.
Step IV : Subtract the two numbers.
Step V : Store the result at memory location D002 H.
Step VI : Stop

Flowchart : Refer flowchart 5.

Program :

Instruction
LXI H, D000 H
MOV
INX H
SUB M
INX H
MOV M, A
HLT

Comment
; L points to the memory location
; D000 H
A, M
; Get the contents of location
; D000 H into the accumulator.
; Increment HL to point to next memory
; location i.e. D001H
; A = A M i.e. compute the subtraction
; Increment HL to point to next memory
; location i.e. D002H
; Store the result at memory location
; D002 H
Flowchart 5

You might also like