Adding the sum of elements in a 2-dimensional array

Newbie Member
23Mar2007,09:27   #1
husslela2's Avatar
How do I add the elements in a two-dimensional array and return the sum into register $v0?

Thanks,
Husslela
Team Leader
30Mar2007,05:51   #2
DaWei's Avatar
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).
Go4Expert Founder
30Mar2007,07:23   #3
shabbir's Avatar
This may also help you to some extent. 8085 Assembly language programming code for beginners.