This program is to find the product of numbers in an array:
We initalize the registers, then we move the size of the array to a counter and reduce its size bu one. SI is incremented to point to the 1st number of the array and move the 1st number into accumularot.
The 2nd number is moved into BL,, we multiply both the numbers abd this is continued till the numbers in the list, exhaust and finally the result is stored in AX.
Code:
MOV SI, 2000
MOV DI,4000
MOV AX,O
MOV BX,0
MOV CX,0
MOV CL,[SI]
SUB CL,[SI]
INC SI
MOV AL,[SI]
AGAIN: INC SI
MOV BL, [SI]
MUL BL
LOOP AGAIN
MOV [DI],AX
INT A5
Thus the program for product of numbers in an array can be executed using the above code.
Dec 2, 2008
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment