I realised that though intel chips are little endian when it comes to storing data in data segment, but 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?
I realised that though intel chips are little endian when it comes to storing
Share
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.