Big Andian and Little Andian

This is a snapshot of the memory of a byte-addressed computer. What will be loaded into the register $16 after the lw $16, 24($17) command is lw $16, 24($17) , if the machine is big, and when Little Endian. Register $17 contains 200 .

enter image description here

Now, according to me, four bytes will be copied from memory (224-227) regardless of Little Endian or Big Endian, then if the machine is Big Endian, then they will be copied to the register as they are.

If the machine is Little Endian, it will be canceled and then copied to the register.

I ask you if I am mistaken in this concept.

+6
source share
1 answer

You're right.

More technically, in large line mode, the most significant byte is the one with the lowest address, and the low byte with the highest address. In low-drive mode, the most significant byte is the one with the highest address, and the least significant byte with the lowest address.

Thus, the contents of register $ 16 will be

If big-endian → BADADBBD If little-endian → BDDBDABA

+6
source

Source: https://habr.com/ru/post/901019/


All Articles