title: Assembly 8086 program
body: <p>I am new to assembly language and this is some code that I didn't understand hoping that someone would help with it.</p>
  
  <pre><code>DATA SEGMENT
       VALUES DB 1,2,3,4,5,6,7,8,9
       ITEM DB 6
  DATA ENDS
  CODE SEGMENT
       ASSUME CS:CODE,DS:DATA
  START: MOV AX,DATA
         MOV DX,AX
         LEA SI,VALUES
         MOV AL,ITEM
  COMPARE: CMP AL,[SI]
           JZ Found
           INC SI
           LOOP COMPARE
           CLC
           JMP EXIT
  Found: STC
  EXIT: MOV AH,4CH
        INT 21H
        ENDS
  CODE END
  </code></pre>
  
  <p>This program is supposed to look for number <code>(6)</code> among <code>1,2,3,4,5,6,7,8,9</code></p>
  
  <p>I understand how it works in general but I have a few questions:</p>
  
  <ol>
  <li>Why did we use <code>CLC</code> and <code>STC</code> ?? I know they put <code>CF</code> into zero and one but why do we use it??</li>
  <li>Why did we use <code>MOV AH,4CH</code> in after the <code>EXIT</code> label??</li>
  <li><p>After the start label why did we <em>say</em> the following:</p>
  
  <p>MOV AX,DATA<br>
  MOV DX,AX</p></li>
  </ol>
  
  <p>Why didn't we just <em>say</em>:
  <code>MOV DX,DATA</code></p>
  
  <p>Lastly, Could someone suggest a good book to learn assembly??</p>