Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Assembly Language Programming (ALP) Forum (http://www.go4expert.com/forums/assembly-language-programming-forum/)
-   -   Adding the sum of elements in a 2-dimensional array (http://www.go4expert.com/forums/adding-sum-elements-2-dimensional-array-t3574/)

husslela2 23Mar2007 09:27

Adding the sum of elements in a 2-dimensional array
 
How do I add the elements in a two-dimensional array and return the sum into register $v0?

Thanks,
Husslela

DaWei 30Mar2007 05:51

Re: Adding the sum of elements in a 2-dimensional array
 
Here's the general procedure. A true array is contiguous in memory. Set the accumulator value ($v0, in this instance) to zero. Set an index register to the first element, add that element to the accumulator, increment the index, repeat for the entire length of the array (nRows * nColumns).

shabbir 30Mar2007 07:23

Re: Adding the sum of elements in a 2-dimensional array
 
This may also help you to some extent. 8085 Assembly language programming code for beginners.


All times are GMT +5.5. The time now is 12:02.