Big/Little Endians and MIPS : does load immediate reverse order?

270 Views Asked by At

I have trouble understanding the behaviour of mips regarding endiannes.

(1) Can it be that on some architecture, the bit sign is accessed with the mask 0x00000001 instead of 0x80000000 ?

(2) if yes, then does the (pseudo) instruction li (load immediate) reverse the bit pattern to match endianness ? (e.g. li $t0 2)

thanks

1

There are 1 best solutions below

0
On BEST ANSWER

Endianness affects how bytes are addressed in memory. When a word is loaded into a CPU register, the register ends up holding the same bit pattern no matter what the endianness of the memory layout. Thus the sign bit is always the most significant bit of a register with mask 0x80000000. The bit pattern in a li instruction does not depend on the endianness of the memory layout