I'm new in MIPS and trying to teach myself using this book. I'm trying to learn data directive and what are the difference between these three :
list: .word 0:3
list: .word 3
list: .word
But I didn't find any clear document/reference.
Thank you.
list: .word 0:3
Will reserve 3 words and set each to the value 0. This would be similar to:
int list[3] = {0, 0, 0};
Or
list: .space 12
(In which case, the value is implicitly 0).
The 0 in '0:3' could have very well be any other value. For example:
list: .word 'X':3
# or
list: .word 88:3
When the number of elements is missing, it's simply the value of the word
list: .word 3
Which is similar to
int list = 3;
The last one,
list: .word
Will likely cause assemblers to complain for the missing operand.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With