Question: Hello, I am currently learning how to use MIPS assembly language, but I'm stuck on something. I have a 2d array that is block_arr: .byte
Hello, I am currently learning how to use MIPS assembly language, but I'm stuck on something.
I have a 2d array that is
block_arr:
.byte 1,2,3,4
.byte 2,3,4,1
.byte 3,4,1,2
.byte 4,1,2,3
Here's the problem I'm stuck on:
You will make a function called get_block_address. You can put it at the bottom of the file if you want. It should:
Take the column number in a0
Take the row number in a1
Calculate the correct address in block_arr (using the calculation you figured out above), and put that address in v0
It should not use lw. It should return the address of the given array slot.
I'm really stuck with this problem, any help would be appreciated, and it would be cool if you could explain the thought process. Thanks a lot! Also, I don't even know if thats how I'm supposed to do a 2d array, so please correct me if its faulty.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
