title: How to compare 2 number?
body: <p>i am writing a program that compare 2 numbers that have been defined in data segment. 
  i define them like this</p>
  
  <pre><code>Dseg SEGMENT PARA PUBLIC 'data'
  NUM1 DW 1 ; num1 = 1
  NUM2 DW 2 ; num2 = 2
  MAX DW ?  ; variable to save the max number
  MIN DW ?  ; variable to save the min number
  Dseg ENDS 
  
  
  Cseg SEGMENT PARA PUBLIC 'code'
      ASSUME  CS : Cseg , DS : Dseg , SS : Sseg , ES : NOTHING
      ORG 100H
  
      Mov AX , Dseg
      Mov DS , AX
  
      Mov AX , NUM1 ; move num1 to AX   
      CMP AX , NUM2 ; compare num1 with num2
      JAE MAX1      ; jump if num1 &gt; num2
  
      Mov AX  , NUM2; ax = num2
      Mov MAX , AX  ; max = ax
      Mov AX  , NUM1; ax = num1
      Mov MIN , AX  ; min = ax
      JMP ENDPROG 
  
  MAX1 :
      Mov AX  , NUM1; ax = num1
      Mov MAX , AX  ; max = ax
      Mov AX  , NUM2; ax = num2
      Mov MIN , AX  ; min = ax    
      JMP ENDPROG 
  
  ENDPROG :  
      ;..............
  
  
      Mov AX , 4c00H
      INT 21H 
  
  
      Cseg ENDS
  
      END
  </code></pre>
  
  <p>but the jump orders does not work well! and it stuck at ENDPROG label.
  i want to know why is that?
  what is wrong with this code?</p>