to
if you look at the code I wrote .. (it should be correct) .. you can see that for same value, different endian will store in ram same value with different byte order. Can we agree on that?
I agree its stored in 4 different 8 bit registers, one set in ascending the other in descending byte order.
Now, let us look at the register, it is also "memory location" only within CPU. and the number is stored in that register (24bit register is 3 bytes)
Its not a 24bit register, but three separate, 8 bit registers.
in same order as it is stored in RAM. so, physical location of the highest significant bit of the 3byte binary value will not be on the leftmost physical position of the register that is 3byte big on the big endian box. so, in theory, if we have 2byte register that can be also addressed as 2 single byte registers
then if BX = 0xFF00;
on low endian
BH=0xff;
BL=0x00;
and on big endian
BH=0x00
BL=0xFF
so the difference is how the value (value is always same) stored physically inside the register/RAM it does not mean that binary representation of that number is different ... as 0x010101 is allways 0x010101 no matter what CPU/MCU/device is used ..
now, where do I make mistake ...
for little endian, if AX = 0xFF00