也就是对于同一块连续的内存,在小端模式下输出其地址,和,在大端模式下输出其地址,这两个地址一样么?如果一样,那都是低地址么?还是.....
-------------------------------补充------------------------
数据地址的存储方向因为大小端会有不同,这我知道,我想知道的是,是否会因为大小端,造成在取一段连续内存的地址时,输出不同呢?比如说,一个输出了该段内存的低地址,另一个输出了高地址?
迷茫2017-04-17 15:37:36
Whether it is big endian mode or little endian mode, the output address is the same.
All low addresses are returned.
PHP中文网2017-04-17 15:37:36
Both are low addresses
Big and small endianness only affects the parsing order and not the address
黄舟2017-04-17 15:37:36
Give you an example, if you want to save 0x12345678 to 0x10000000,
In little endian mode:
0x78 exists 0x10000000
0x56 exists 0x10000001
0x34 exists 0x10000002
0x12 exists 0 x10000003
In big endian mode:
0x12 exists as 0x10000000
0x34 exists as 0x10000001
0x56 exists as 0x10000002
0x78 exists as 0x10000003
大家讲道理2017-04-17 15:37:36
This is an x86 machine, little endian, I don’t know if you understand it. Let me explain a little bit, the address of a
is 0x4007cd
, a single byte is printed in sequence as cd 07 40 00
, two bytes are printed as 07cd 0040
, and four bytes are printed as 004007cd
, so the big and small ends are correct It doesn't matter from the upper level. If it is at the assembly level, it is still very obvious. For example, mov al, ah
and the like have to consider the issue of big and small endianness.