Microprocessor 8085 Appendix A
Microprocessor 8085 Appendix A
Appendix A
Explanation :
We are given a series of numbers. The length of series is stored at memory location D000 H. We will
initialise register C as counter with the length of the series.
We will initialise the accumulator with 00 H, so that the sum can be stored in the accumulator.
The series begins at D001 H. So, we will initialise HL the register pair as memory pointer to point the
series.
Using add instruction, add the contents, of the accumulator with the contents of memory location
pointed by HL register pair. The result of this addition will be stored in the A register.
Then we will increment HL to point to next memory location of the series. Decrement the count in
register C. Continue this process till the count is zero i.e. all the numbers in the series are added.
Store the result at memory location E000 H.
Example : Let D000 = 05 H i.e. series is of 5 numbers.
D001 = 08 H
D002 = 12 H
D003 = 74 H
D004 = 34 H
D005 = 04 H
Result = 08 H + 12 H + 74 H + 34 H + 04 H = C6 H
E000 H = C6 H.
Algorithm :
Step I
Step II
Step III