title: Most Efficient way to set Register to 1 or (-1) on original 8086
body: <p>I am taking an assembly course now, and the guy who checks our home assignments is a very pedantic old-school optimization freak. For example he deducts 10% if he sees:  </p>
  
  <pre><code>mov ax, 0
  </code></pre>
  
  <p>instead of:</p>
  
  <pre><code>xor ax,ax
  </code></pre>
  
  <p>even if it's only used once.</p>
  
  <p>I am not a complete beginner in assembly programing but I'm not an optimization expert, so I need your help in something (might be a very stupid question but I'll ask anyway):
  if I need to set a register value to 1 or (-1) is it better to use:  </p>
  
  <pre><code>mov ax, 1
  </code></pre>
  
  <p>or do something like:  </p>
  
  <pre><code>xor ax,ax
  inc ax
  </code></pre>
  
  <p>I really need a good grade, so I'm trying to get it as optimized as possible. ( I need to optimize both time and code size)</p>