title: Question about setg and comparison in Assembly
body: <p>I'm having problem understanding this exercise. I'll try my best to give my reasoning and I hope you guys can give me an idea what each line of code demonstrates. The Assembly we use is x86
  assume the value stored in %rax = x</p>
  
  <pre><code>xorq  %rax, %rax // value stored in %rax: x ^ x = 0
  addq  $-1,  %rax // value stored in %rax: 0 - 1 = -1
  movq  %rax, %rbx // value stored in %rbx: -1 or 0xFFFFFFFF
  shlq  $2,   %rbx 
  shrq  $1,   %rbx // left shift by 3 total, so value stored in %rbx: 0x7fffffff8
  addq  %rbx, %rax // value stored in %rax: 0x7fffffff9
  </code></pre>
  
  <p>For the last line, my professor says we actually computing (TMax-1)-1, which I really don't get.</p>
  
  <p>The question is:</p>
  
  <blockquote>
    <p>Assuming the addq from Q3.2 did execute, say we now executed the following instruction:</p>
  </blockquote>
  
  <pre><code>setg %bl
  </code></pre>
  
  <blockquote>
    <p>What value (in hex, including the prefix) is now stored in %rbx?</p>
  </blockquote>
  
  <p>I really don't understand what setg means (I did read the specification but at a lost). Thanks a lot for helping !</p>