title: Adding signed numbers in assembly
body: <p>I want to sum an array elements. This array contains positive and negative numbers.</p>
  
  <pre><code>array db 07, 00, -3, 10, -7, 14, 9, -5, -100
  
  
  lea ax, data
  mov ds, ax
  mov es, ax
  
  lea si, array
  mov cx, [si] 
  mov si, 0002h
  xor ax, ax
  xor dx, dx 
  Addition:
  mov bl, [si]
  cmp bl, 00h
  jl NEGATIVE
  xor bh, bh ;
  jmp NEXTT
  NEGATIVE:
  mov bh, 0ffh
  NEXTT:
  add ax, bx
  adc dx, 0
  add si, 1
  loop Addition
  </code></pre>
  
  <p>The sum (<code>DX:AX</code>) using this code = 0003 FFAE H which is wrong. I think that the right answer is 
  FFFFFFAE H.</p>
  
  <p><strong>1- How can I fix this problem?</strong></p>
  
  <p><strong>2- How can I know whether a number in a register (AX for example) is positive or negative?</strong></p>
  
  <p><strong>I use emu8086</strong></p>