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:
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?

没有评论:
发表评论