title: In x86 assembly how can you set the zero flag (ZF) without doing a compare operation?
body: <p>I have a short piece of (x86) assembly that I am trying to figure out what it does.</p>
  
  <pre><code>...
   6:     81 ec 00 01 00 00       sub    $0x100, %esp
   c:     31 c9                   xor    %ecx  , %ecx
   e:     88 0c 0c                mov    %cl   , (%esp, %ecx, 1)
  11:     fe c1                   inc    %cl
  13:     75 f9                   jne    0xe
  ....
  </code></pre>
  
  <p>It looks like its looping though until the "JNE" evaluates to false, i.e. the zero flag = 0.  (possibly its putting the numbers 1, 2, 3 ... into the stack??)</p>
  
  <p>From my short investigation into assembly (im new at this) it seam you set the zero flag by doing a compare operation (CMP), but I dont see a compare operation. </p>
  
  <p>So, under what conditions will it break out of this loop?</p>