Professional Documents
Culture Documents
Experiment No. 1: Title: Aim
Experiment No. 1: Title: Aim
AIM: Write 8086 Assembly language program (ALP) to add an array of N numbers stored
in the memory
THEORY:
Explanation:
Consider that a block of N bytes is present at source location.
Let the number of bytes N=10
We have to add these N bytes
We will initialize this as count in the CX register
SI register contain source address which will act as pointer.
Clear direction flag.
Using ADD instruction add the contents byte by byte of the block.
Increment SI to point to next element.
Decrement the counter and add the contents till all the contents are added.
Result is stored in AL.
Display the contents using display routine.
Example : Block Data :01 02 03 04 05 06 07 08 08 0A
Result: 01+02+03+04+05+06+07+08+09+0A=37 H
Algorithm :
Step 8: Check for count in CX,if not zero goto step 5 else goto step 9.
Start
Initialise CX=count
DF=0
Sum=sum+[pointer]
Increment pointer SI
Decrement count in CX
count=0
Stop
Conclusion: