X86 Modrm / Sib / Offset Bytes for Operation Code '89'

I am developing a disassembler for the x86 32-bit instruction set. My code currently decodes code codes 1 and 2 bytes correctly, but I ran into a problem. When I compare the output of my code with Objdump, I find that Objdump sees the following: -

89 14 98                mov    %edx,(%eax,%ebx,4)

8b 45 d8                mov    -0x28(%ebp),%eax

On the other hand, my code gives: -

89 14 98 8B 45 D8 89   MOV.

From my understanding of the Intels documentation (in particular, the Modrm and Sib addressing form tables), this byte stream should be interpreted as: -

89 - The opcode
14 - The Modrm byte
98 - The Sib byte specified by the Modrm byte (as shown in Intels Modrm addressing table)
8B 45 D8 89 - The four byte displacement specified by the Sib byte (as shown in Intels Sib addressing table).

Objdump says there are no offset bytes, but both my code and Intels documentation appear (at least to me) to say otherwise.

If anyone can point out where my mistake is, that would be very appreciated.

Thank.

+5
source share
1 answer

Mod/RM 0x14 Mod = 00 Reg = 010 R/M = 100.

http://download.intel.com/design/intarch/manuals/24319101.pdf 2-2 ( "2-6", 36 PDF) Mod = 00 R/M = 100 SIB .

, , . Intel.

+4

All Articles