title: What is assembly cmp instruction comparing exactly?
body: <p>I'm learning assembly language and encountered a problem that I don't know even how to ask Google. I'm using gdb to debug simple c program.</p>
  
  <p>I have following code:</p>
  
  <pre><code>cmp    eax,DWORD PTR [rbp-0xc]
  jle    0x400cc2
  </code></pre>
  
  <p>Breaking on the cmp instruction, I'm checking values for the comparison:</p>
  
  <pre><code>p/d $eax // 1000
  x/d $rbp-0xc //-24
  </code></pre>
  
  <p>So I assume, that the jump won't happen. But after going to the next step - I can see that ZF flag is set. 
  Could  someone please explain in simple words?</p>