title: Unfamiliar syntax for the "imul" instruction in x86 assembly
body: <p>I've written a very basic C-function called "multby22", which does exactly what its name implies: it takes a long and returns that long multiplied by 22. (I know it's a pointless function but I wrote it to try and help me with x86 assembly.) So:</p>
  
  <pre><code>long multby22(long x) {
      return 22 * x;
  }
  </code></pre>
  
  <p>When I complied the program and ran "objdump" on the executable, I found the disassembled code for "multby22" to be the following:</p>
  
  <pre><code>080483ff &lt;multby22&gt;:
     80483ff:       55                    push   %ebp              
     8048400:       89 e5                 mov    %esp,%ebp         // Create the stack frame.
     8048402:       8b 45 08              mov    0x8(%ebp),%eax    // Grab the argument and put it into the %eax register.
     8048405:       6b c0 16              imul   $0x16,%eax,%eax   // ???
     8048408:       5d                    pop    %ebp              // Pop the buffer pointer and return.
     8048409:       c3                    ret   
  </code></pre>
  
  <p>I understand that "imul" is for integer multiplication, but I have been unable to find anything that helps me with this syntax! The closest I have found is:</p>
  
  <pre><code>imul [reg] [reg] [const]
  </code></pre>
  
  <p>...where the 2nd and 3rd arguments are multiplied together and then placed into the 1st argument, which must be a register. In the assembly I generated, the 1st argument is a constant!</p>