|
@@ -0,0 +1,25 @@
|
|
|
+ .data
|
|
|
+array: .space 400
|
|
|
+row: .word
|
|
|
+column: .word
|
|
|
+base: .word
|
|
|
+address: .word
|
|
|
+elements_in_row:.word 10
|
|
|
+elements_in_col:.word 10
|
|
|
+size: .word 4
|
|
|
+
|
|
|
+
|
|
|
+ .text
|
|
|
+__start:move row,0
|
|
|
+ move column,0
|
|
|
+ la base, array
|
|
|
+loop: beq row, elements_in_col, endloop
|
|
|
+ mul address, row, elements_in_row
|
|
|
+ add address, address, column
|
|
|
+ mul address, address, size
|
|
|
+ add address, address, base
|
|
|
+ move M[address], 5
|
|
|
+ add row, row, 1
|
|
|
+ add column, column, 1
|
|
|
+ b loop
|
|
|
+endloop:done
|