title: x64 instruction encoding and the ModRM byte
body: <p>The encoding of</p>
  
  <pre><code>call qword ptr [rax]
  call qword ptr [rcx]
  </code></pre>
  
  <p>is</p>
  
  <pre><code>FF 10
  FF 11
  </code></pre>
  
  <p>I can see where the last digit (0/1) comes from (the register number), but I'm trying to figure out where the second last digit (1) comes from. According to <em>AMD64 Architecture Programmer’s Manual Volume 3: General-Purpose and System Instructions</em> page 56,</p>
  
  <p>"/digit - Indicates that the ModRM byte specifies only one register or memory (r/m) operand. The digit is specified by the ModRM reg field and is used as an instruction-opcode extension. Valid digit values range from 0 to 7."</p>
  
  <p>The equivalent Intel document says something similar, and <code>call</code> via a register is specified to be encoded as</p>
  
  <pre><code>FF /2
  </code></pre>
  
  <p>and... I have no idea what that means, or how the 2 in the specification connects to the high 1 digit in the end result. Is there a differently worded explanation available anywhere?</p>