Anyone here have assembly knowledge? Writing matrix addition in MIPS and I don't know how to sw to an array index
How can I do this? sw to index[i] of a word array?
>>60115268
>tfw I actually had to do this at work recently
>>60115395
...could you help me out then ?
>>60115268
Did something like this recently. I believe you would have to sw with base register offsetted by the index * the size of whatever data type you're using (in your case, word, which i believe is size 4). So if the base register for your .data is say $10, then the first element in the array would be at (0)$10, the second at 4($10), and so on. Let me know if this helps.
>>60115445
I'll post the formula for it when I get the chance
>>60115586
>>60115445
It's &(a[i][j]) = &a + (j * NCOLS + i) * WORDSIZE
>>60115584
worked like a charm, thanks m80
>>60115268
Are you at UCF?