title: Division causes unbalanced parentheses
body: <p>In GNU <code>as</code> (the GNU assembler), the following code assembles without error:</p>
  
  <pre><code>mov $(80 * 24 + 4), %cx
  </code></pre>
  
  <p>However, this code does not:</p>
  
  <pre><code>mov $(80 * 24 / 4), %cx
  </code></pre>
  
  <p>Emitting the highly unexpected error:</p>
  
  <pre><code>example.S: Assembler messages:
  example.S:42: Error: unbalanced parenthesis in operand 1.
  </code></pre>
  
  <p>The only difference is that the latter uses division, instead of addition. This should be valid, <a href="https://sourceware.org/binutils/docs/as/Infix-Ops.html#Infix-Ops">according to the manual</a>.</p>
  
  <p>(<code>$&lt;expression&gt;</code> embeds an immediate into the assembled output; i.e., a constant. The arithmetic is performed at "compile-time". I could work out the math, but it makes more sense in its expanded form.)</p>