<html lang="en">
<head>
<title>i386-Notes - Using as</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="Using as">
<meta name="generator" content="makeinfo 4.8">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="i386_002dDependent.html#i386_002dDependent" title="i386-Dependent">
<link rel="prev" href="i386_002dBugs.html#i386_002dBugs" title="i386-Bugs">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
@import url("../raisonance.css");
  pre.display { font-family:inherit }
  pre.format  { font-family:inherit }
  pre.smalldisplay { font-family:inherit; font-size:smaller }
  pre.smallformat  { font-family:inherit; font-size:smaller }
  pre.smallexample { font-size:smaller }
  pre.smalllisp    { font-size:smaller }
  span.sc    { font-variant:small-caps }
  span.roman { font-family:serif; font-weight:normal; } 
  span.sansserif { font-family:sans-serif; font-weight:normal; } 
--></style>
</head>
<body>
<div class="node">
<p>
<a name="i386-Notes"></a>
<a name="i386_002dNotes"></a>
Previous:&nbsp;<a rel="previous" accesskey="p" href="i386_002dBugs.html#i386_002dBugs">i386-Bugs</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="i386_002dDependent.html#i386_002dDependent">i386-Dependent</a>
<hr>
</div>

<h4 class="subsection">8.11.13 Notes</h4>

<p><a name="index-i386-_0040code_007bmul_007d_002c-_0040code_007bimul_007d-instructions-907"></a><a name="index-g_t_0040code_007bmul_007d-instruction_002c-i386-908"></a><a name="index-g_t_0040code_007bimul_007d-instruction_002c-i386-909"></a><a name="index-g_t_0040code_007bmul_007d-instruction_002c-x86_002d64-910"></a><a name="index-g_t_0040code_007bimul_007d-instruction_002c-x86_002d64-911"></a>There is some trickery concerning the `<samp><span class="samp">mul</span></samp>' and `<samp><span class="samp">imul</span></samp>'
instructions that deserves mention.  The 16-, 32-, 64- and 128-bit expanding
multiplies (base opcode `<samp><span class="samp">0xf6</span></samp>'; extension 4 for `<samp><span class="samp">mul</span></samp>' and 5
for `<samp><span class="samp">imul</span></samp>') can be output only in the one operand form.  Thus,
`<samp><span class="samp">imul %ebx, %eax</span></samp>' does <em>not</em> select the expanding multiply;
the expanding multiply would clobber the `<samp><span class="samp">%edx</span></samp>' register, and this
would confuse <code>gcc</code> output.  Use `<samp><span class="samp">imul %ebx</span></samp>' to get the
64-bit product in `<samp><span class="samp">%edx:%eax</span></samp>'.

   <p>We have added a two operand form of `<samp><span class="samp">imul</span></samp>' when the first operand
is an immediate mode expression and the second operand is a register. 
This is just a shorthand, so that, multiplying `<samp><span class="samp">%eax</span></samp>' by 69, for
example, can be done with `<samp><span class="samp">imul $69, %eax</span></samp>' rather than `<samp><span class="samp">imul
$69, %eax, %eax</span></samp>'.

<!-- Copyright 2000, 2003 Free Software Foundation, Inc. -->
<!-- This is part of the GAS manual. -->
<!-- For copying conditions, see the file as.texinfo. -->
</body></html>

