<<< Data Organization: DB, DW, and EQU | Index | Little Endian Example >>> |
Consider a small program, little_endian.asm .
Assembler fragment of little_endian.lst listing file shows generated data and code:
00000000 .DATA 00000000 EE FF byte0 BYTE 0EEh, 0FFh 00000002 1234 word2 WORD 1234h 00000004 56789ABC var4 DWORD 56789ABCh 00000008 00000000 var8 DWORD 0 00000000 .CODE 00000000 _start: 00000000 B8 00000002 R mov eax, OFFSET word2 00000005 A3 00000008 R mov [var8], eax 0000000A C3 ret ; Exit program
DUMPBIN output for this program yields:
C:\>DUMPBIN /DISASM little_endian.exe Dump of file E:\little_endian.exe File Type: EXECUTABLE IMAGE __start: 00301000: B8 02 40 30 00 mov eax,304002h 00301005: A3 08 40 30 00 mov dword ptr ds:[00304008h],eax 0030100A: C3 ret
Did you notice something strange about highlighted opcodes?
The byte sequence that belongs to the 32-bit displacement seems out of order: instead of expected
00 30 40 08
we see a reversed sequence,
08 40 30 00.
<<< Data Organization: DB, DW, and EQU | Index | Little Endian Example >>> |