2021年3月12日星期五

MARS MIPS Simulator ASCII string not storing in memory in little-endian properly?

I have heard that the MARS MIPS Simulator is little-endian so I expect that if I reserve the string "HELLO" using .asciiz "HELLO" in the memory, I would find the character O to be in the lowest memory address and H in the highest memory address of the given string.

But when I assembled the code, MARS's debugger shows memory like this:

this

H is stored in the 0x10010000 address (the data segment base address) and O is stored in the 0x10010004 -- clearly stored in a higher memory address. Isn't this big-endian?

But, I've noticed that when I reserve word-size data like 0x0000ABCD using .word 0xABCD, D would be placed in the lowest memory as what a little-endian system must do. Why do they store data differently?

https://stackoverflow.com/questions/66609885/mars-mips-simulator-ascii-string-not-storing-in-memory-in-little-endian-properly March 13, 2021 at 11:37AM

没有评论:

发表评论