title: Loops and conditionals in TASM Assembly 8086 DOS
body: <p>I want to run this loop with a conditional at the end in this fashion</p>
  
  <pre><code>mov cx, 10
  mov di, 0
  
  loop:
  
  ...
  
  inc di
  dec cx
  
  cmp di, 5
  jne loop
  
  ...     
  
  jnz loop
  </code></pre>
  
  <p>but it seems like it won't work unless I decrement cx immediately before </p>
  
  <pre><code>jnz loop
  </code></pre>
  
  <p>this is preventing me from decrementing cx each time that <code>di != 5</code>. 
  I think I am misunderstanding the proper use of cx</p>