x64 instruction encoding and the ModRM byte

前端 未结 2 1877
借酒劲吻你
借酒劲吻你 2020-11-27 23:11

The encoding of

call qword ptr [rax]
call qword ptr [rcx]

is

FF 10
FF 11

I can see where the last digit (

2条回答
  •  爱一瞬间的悲伤
    2020-11-27 23:40

    The ModR/M byte has 3 fields:

    bit 7 & bit 6 = mod
    bit 5 through bit 3 = reg = /digit
    bit 2 through bit 0 = r/m
    

    This is depicted in Figure 2-1. Intel 64 and IA-32 Architectures Instruction Format of Vol. 2A of Intel® 64 and IA-32 Architectures Software Developer’s Manual.

    So, there:

      0x10 = 00.010.000 (mod=0, reg/digit=2, r/m=0)

    and

      0x11 = 00.010.001 (mod=0, reg/digit=2, r/m=1).

提交回复
热议问题