Small-endian byte or bit-order in x86 architecture?

The title says it all. I want to know when an x86 instruction reads data from memory, does it translate bytes or bits into Little-Endian order. For example, if we have the following data at address "0" (in binary format) (recorded here in RAW format, sequential):

00110010 01010100

And if I read it as follows:

mov ax, word [0]

What is "ax" - "01010100 00110010" or "00101010 01001100"? Or is it converted to an unsigned integer (suppose xiger intiger instructions will interpret consecutive binary binary register data as a Big Endian binary, the same end as Arabic numbers) in decimal form - "21554" or "10828"?

+4
source share
3 answers

1.3.1 Bit and x86 byte order is inactive. In the illustrations of in-memory data structures, lower addresses are displayed at the bottom of the figure; addresses increase to the beginning. Bit positions are numbered from right to left. The numerical value of the set bit is two raised to the power of the bit position. IA-32 processors are small-end machines; this means that bytes the word is numbered starting with the least significant byte. Figure 1-1 illustrates these conventions.

enter image description here

endian endianness , , , . , 8- , . , , , , .

. Big-Endian , ( . ). , .

"0A 0B 0C 0D" ( 4 , - , ) a, a +1, a + 2 a + 3; 0A a, 0B + 1, 0C + 2 0D + 3. 0D, a, 0C + 1, 0B + 2 0A + 3.

enter image description hereenter image description here

, , endianness , .

+11

AFAIK, endianness , , , .

"" "" ( 1, 2, 4 8 ), "" "" . .

x86 , , ( ). , 0x01, 0x02, 0x03 0x04 32- 0x04030201, 16- 0x0201 0x0403 4 ( , , .. 8- - , , x86).

+5

Binary , hex; , .

, 21 554 ( ).

...

-, Equ $

Some_16_Bit_Value   Equ         $
                    Db          032h
                    Db          054h

, .Data - .Code..

        Mov         Ax, Word Ptr [Some_16_Bit_Value]        ;See what you get

, ...

        mov         ax,word ptr [Some_16_Bit_Value (13FE9A002h)] 

(.. 13FE9A002h)

: 32 54 ( , )

mov

, AX 5432 ( , 21 554)

+1

All Articles