I have the following MIPS program that simply prints hello world:
.data
.word 12345
.word 0x1234ffff
message: .asciiz "Hello World! \n"
.text
main:
li $v0, 4
la $a0, message
syscall
li $v0, 10
syscall
Upon inspecting QtSpim's data tab, it shows the following:
[10000000]..[1000ffff] 00000000
[10010000] 00003039 1234ffff 6c6c6548 6f57206f 9 0 . . . . 4 . H e l l o W o
[10010010] 21646c72 00000a20 00000000 00000000 r l d ! . . . . . . . . . . .
[10010020]..[1003ffff] 00000000
I can see that 12345
and 0x1234ffff
has gone into address 0x10010000
and 0x10010004
respectively in big-endian format, but what confuses me is the ascii string representation I tried to interpret:
10010008: 6c ‘l’
10010009: 6c ‘l’
1001000a: 65 ‘e’
1001000b: 48 ‘H’
1001000c: 6f ‘o’
1001000d: 57 ‘W’
1001000e: 20 ‘ ‘
1001000f: 6f ‘o’
10010010: 21 ‘!’
10010011: 64 ‘d’
10010012: 6c ‘l’
10010013: 72 ‘r’
10010014: 00 empty for word-alignment?
10010015: 00 ‘\0’
10010016: 0a ‘\n’
10010017: 20 ‘ ‘
So it seems like QtSpim have split up the string into words and stored them in little-endian order.
This doesn't make any sense to me since the first two word data were stored in big-endian format, but for strings it suddenly decides to take this weird approach? I especially can't understand why it splits the string into words and then stores them in little-endian order.