title: comparing characters in assembly, nasm
body: <p>i am trying to get input from the user and then i would like to output some text depending on what the user put in.</p>
  
  <p>my issue is for some reason it always thinks it is A and i dont know why.
  you can find my code below:</p>
  
  <pre><code>            bits 16
              org 0x100
              jmp main
  message:    db 'Please enter a A or B:',0ah,0dh,'$'
  character:  db 1
  outp_a:     db 'IT IS A',0ah,0dh,'$'
  outp_b:     db 'IT IS B',0ah,0dh,'$'
  finish      db 'good bye',0ah,0dh,'$'
  
  clearscreen:
              mov dx, 10 
              mov bh, 0
              mov ah, 2
              int 10h
              mov cx, 2000 
              mov bh, 0
              mov bl, 01Eh 
              mov al, 20h 
              mov ah, 09h
              int 10h
              ret
  
  disply:     
              mov ah,09h
              int 21h
              ret
  
  get_input:  mov ah,01h
              int 21h
              ret
  
  input_a:    mov dx,outp_a
              call disply
              ret
  input_b:    mov dx,outp_b
              call disply
              ret
  
  compare:    mov cl,'A'
              cmp [character],cl
              JAE input_a
              mov cl,'B'
              cmp [character],cl
              JAE input_b 
              ret
  
  main:       call clearscreen
              mov dx,message
              call disply
              call get_input
              mov [character],ax
              call compare
              mov dx,finish
              call disply
              int 20h
  </code></pre>