Reputation: 161
So I have a board game and the user is expected to enter the size of the board 3,4,5 ...will be 3x3, 4x4, 5x5, etc...
Here:
board: .word 0:100 # declare a board of size 100 and make ints '0' , O = 1, X = 2
As you can see, this is static declaration...I need to somehow make an array the SIZE of the user input found in t0 for example...
Upvotes: 8
Views: 5506
Reputation: 1076
It sounds like you need to allocate some memory on the heap. The MARS emulator syscall
for that is $v0 = 9, $a0 = number of bytes to allocate, returns address of allocated memory in $v0. Source: MIPS syscall functions available in MARS
So your steps would be:
Upvotes: 10