Microprocessor 8085 Appendix A
Microprocessor 8085 Appendix A
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
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