开发者

Little endian Vs Big endian convention in x86 chips [duplicate]

开发者 https://www.devze.com 2023-03-10 13:40 出处:网络
This question already has an answer here: How to interpret objdump disassembly output columns? (1 answer)
This question already has an answer here: How to interpret objdump disassembly output columns? (1 answer) Closed 2 years ago.

I realised that though intel chips are little endian when it comes to storing data in data segment, but 开发者_JAVA百科same chips are big endians when it comes to store machine code in code segment. An opcode for MOV AL,57 is B057. B0 is stored in low byte and 57 is stored in next higher byte. Is it that the convention of little or big endian only applies to the data segment only?


endianess concern itself with how the bytes are stored to make up larger data types, such as whether the least significant byte is stored first or last in memory of e.g. a 16 bit integer.

that piece of machine code consists of several individual parts, it's not combined to be treated as an integer, so it doesn't make senese to talk about endianess there. Now, if you have an op code operating on an immediate integer that's larger than a byte, that integer will be stored in little endian though as part of the code.


Endianness refers to representation of data types. Opcodes are not data (at least, not in this sense), so endianness is not relevant.

0

精彩评论

暂无评论...
验证码 换一张
取 消