Reputation: 11
Is there any way to get the number of bytes in an array?
.data
array: .space 40
...
some other code
Is there anyway to put the number 40 into a register to use it as a variable?
Upvotes: 1
Views: 378
Reputation: 6266
.data
array: space 40
array_end:
...
.text
...
la $t0, array
la $t1, array_end
sub $t2, $t1, $t0 # $t2 should contain 40
...
The above code should leave the size of array
in $t2
Upvotes: 1