title: x86 Asm Assembler . Difference between signed and unsigned - and 8 and 16 variable
body: <p>I have to write an assembly program that calculates (a * (bc) * d) where a, b, c, d
  are variables stored into the data segment in signed 8-bit format. 
  (I have to assume that the result is represented as a signed 32-bit number)</p>
  
  <p>I have written the following code</p>
  
  <pre><code>data segment
  
      a db 1
      b db 9
      c db 3
      d db 4 
  
      x dw ?
  
  
  ends
  
  stack segment
      dw   128  dup(0)
  ends
  
  code segment
  start:
  
      mov ax, data
      mov ds, ax
      mov es, ax
  
  
      ; what would the difference be in the following three lines if the variables where signed?
      mov al, b
      sub al,c
      mul a
      mul d
  
  
      ;treating result as a 16bit - how about signed?
      mov x,ax 
  
  
  
  
  
      mov ax, 4c00h ; exit to operating system.
      int 21h    
  ends
  
  end start
  </code></pre>
  
  <p>My questions are as follows:
  What are the differences in I need to know when treating numbers as signed and ansigned, apart from registry sizes (al,ah,bh,bl, ecc... 8bit), (ax,bx,cd,dx, 16bit)?</p>
  
  <p>How do I treat a 32 bit variable differently than a 16 variable, apart from storing it ito a DW variable?</p>
  
  <p>For your convenience I have written a short version of the questions above in the relavant parts of code.</p>
  
  <p>Can somebody please help me, please?
   Thanks in advance for your time.</p>