title: How to compare an input number in 8086?
body: <p>The problem is to ask a user to input any number. And compare the entered number with a predefined constant number. Then output a message that number the entered is either greater or less than or equal to the defined number. In this example my predefined number is 27.</p>
  <p>My code is:</p>
  <pre><code>   .MODEL small
     .STACK 100h
     .DATA
  promptmsg DB 'Please enter a number [1..100]',13,10,'$'
  greatermsg db 'You have entered a greater number', 13, 10, '$'
  lessmsg db 'You have entered a lesser number', 13 , 10, '$'
  correctmsg db 'You have hit the right number', 13, 10, '$'
  numbr dw 27
     .CODE
     .startup
     mov  ax,@data
     mov  ds,ax                   
     lea dx, promptmsg
     mov  ah,9    
     int  21h                     
     mov ah, 0ah
     int 21h
     mov ah, 9
     int 21h
     mov bx, numbr
     cmp ax, bx
     jb lesser
     ja greater
  correct:
     mov dx, offset correctmsg
     mov ah, 09h
     int 21h
     jmp endexe
  greater:
     mov dx, offset greatermsg
     mov ah, 09h
     int 21h
     jmp endexe
  lesser:
     mov dx, offset lessmsg
     mov ah, 09h
     int 21h
  endexe:
     mov  ah,4ch                 ;DOS terminate program function
     int  21h                    ;terminate the program
     END
     
  </code></pre>
  <p>If I input any number regardless it is greater or less than or equal to the predefined number, it always jumps to greater. Is there any problem with my code, that failed to recognize my input number?</p>