Try this link and see if it helps.
http://www.tutorialspoint.com/assembly_programming/assembly_arrays.htm
Read this... Apparently you have to cheat to create a multidimensional array inx86...
Assembly language doesn't have the concept of a "multidimensional array", at least not directly. You will need to allocate the total amount of space (16 elements in your case), and handle the row/column offset calculations yourself.
share|improve this answer
answered Oct 5 '11 at 2:18
Greg Hewgill
310k65597795
I understand. I have been trying to read through the following link
webster.cs.ucr.edu/AoA/Windows/HTML/Arraysa2.html
but I am getting more confused then before. Do you happen to have any other resources that might assist? – Nic Young Oct 5 '11 at 2:27
Hey, that looks like a great reference, it's the sort of thing I would have pointed you at if you hadn't said that you already were looking at it. Do you have any specific questions we can help with? – Greg Hewgill Oct 5 '11 at 2:30
I know how to declare a 1 dimensional array array BYTE val1, val2, val3, val4 but I am having a hard time understanding how to go about doing that for a 4x4 array – Nic Young Oct 5 '11 at 2:37
Well, one way would be array BYTE val11, val12, val13, val14, val21, val22, ..., val43, val44 (16 values in total). Then, to index into the array, multiply the row value by 4, add the column, and offset that into array. – Greg Hewgill Oct 5 '11 at 2:39
I see it makes more sense now. So declare a 1 dimensional array but arrange the values in such a way it can be treated as 4x4 still. That is exactly what I needed. Thank you! – Nic Young Oct 5 '11 at 2:59
What he did here is creat a one dimensional array, 16 values, then he offsets it by 4 and thus you get your 4 x 4 array... It's confusing even to me but I think I get the concept. That is why you are havin so much trouble, cause you are thinking your creating a 2 dimensional array, but in reality it's only 1 dimensional. This is beyond my current understanding. We have some good computer folk here, so reach out again, and see if someone else can help.
And remember there is no problem you have, that someone else has already solved.... Google the crap out of your problems, and someone will find you a solution. If I understand what he has done above, he created a single dimensional array, with 16 values. Then he offsets, or accesses every 4 values to creating his 4 x 4 array.. But apparently you have to do it yourself. Keep me posted and let me know when you have solved it. This is going to be one of those moments that when you do figure it all out, it is going to hit you in the head and open your eyes wide.