title: Assembly: converting to if statement using two fld, fcomp, fnstsw and test 41h
body: <p>Could some one please help me with understanding the following code?</p>
  
  <pre><code>fld qword ptr [L1000F168]
  fcomp   qword ptr [L1000A2F0]
  fld qword ptr [L1000F168]
  fnstsw  ax
  test    ah,41h
  jnz L100012F0
  </code></pre>
  
  <p>It is output of a compiler converted to assembly from executive code.</p>
  
  <p>What I have caught till now is that </p>
  
  <pre><code>if(value[L1000F168] != value[L1000A2F0])
     continue following
  else
     goto L100012F0
  </code></pre>
  
  <p>Am I correct?</p>
  
  <p>I do not understand why <code>[L1000F168]</code> is loaded two times and why <code>ah</code> is compared with <code>41h</code> here? as <code>41h</code> means (Invalid operation) or (stack fault)?</p>