Open cartoon-raccoon opened 3 months ago
Mars (which I believe saturn is trying to be compatible with) has the same behaviour on a program like this
.data
LBL_1:
.word
LBL_2:
.word
.text
main:
la $t0, LBL_1
la $t1, LBL_2
Yeah, the .word
directive gets a sequence of numbers. So .word 0 1 2 3
is also valid and will create 4 words. .word
with no arguments will take zero words.
While writing in MIPS, I used several .word directives, but didn't initialize them with a value, as they get initialized later on in the program. However, the assembler doesn't honour this and set aside space for them in the final executable.
The fix would be to use
.word 0
, then the assembler does set aside space for them.I'm not sure if this behaviour is intended, as I haven't seen this behaviour among other assemblers, but I thought it was worth bringing to your attention.