Memory is a one-dimensional array. Therefore, a two-dimensional array must be stored as a one-dimensional array. This means that in higher level languages, whenever a multi-dimensional array is declared, it is actually being stored as a one-dimensional array.
Here is an easy way to declare a two-dimensional array
;these declarations belong in the data segment
ROW EQU 3 COL EQU 4 ARR DB ROW*COL DUP(?)
As you can see, this looks like a one dimensional array, and it is. So, where does the structure of the two-dimensional array come from? Answer: YOU!
Consider this two-dimensional array
1 2 3 4 5 6 7 8 9 10 11 12
There are two (easy) ways to store this so that the data can be accessed easily
row major (used in Pascal and C)
1 2 3 4 5 6 7 8 9 10 11 12
column major (used in FORTRAN)
1 5 9 2 6 10 3 7 11 4 8 12
Neither method is wrong, they both work the same way. It is up to you to decide which method you want to use to store an array. It is also up to you to make it clear to someone entering data from the keyboard how you are storing the data. If the user thinks you are storing data by row, but you are actually storing the data by column, then all the results will be wrong, and the user will not like your program at all!
I have provided an example program that will read and print a 3x4 array.
I have also provided some example code that shows how to control the size and storage method (row- or col-major) by using equates. This code also shows how to access the array by row or by column just by changing a few statements.