M Microprocessor 8085 Appendix A
M Microprocessor 8085 Appendix A
Appendix A
Explanation :
Consider that a byte is present at the memory location D000 H and second byte is present at memory
location D001 H.
We have to multiply the bytes present at the above two memory locations.
We will multiply the numbers using successive addition method.
In successive addition method, one number is accepted and other number is taken as a counter. The
first number is added with itself, till the counter decrements to zero.
Result is stored at memory locations E000 H and E001 H.
For example : D000 H = 12 H, D001 H = 10 H
Result = 12H + 12H + 12H + 12H + 12H + 12H + 12H + 12H + 12H + 12H
Result = 0120 H
E000 H = 20 H
E001 H = 01 H
Algorithm :
Step I
Step II
Step III
Step IV
Step V
Step VI
:
:
:
:
:
:
Program :
Instruction
LDA
MOV
MVI
LDA
MOV
LXI
BACK: DAD
DCR
JNZ
D000H
E, A
D, 00
D001H
C, A
H, 0000H
D
C
BACK
SHLD E000H
HLT
Comment
; A = first number
; E = first number
; D = 00 H
; A = second number
; Initialize counter
; Result = 0
; Result = result + first number
; decrement count
; If count 0 repeat
; Store result
; Terminate program execution
Flowchart 19