title: Comparing AX register against zero
body: <p>I have a assembly program to write. I need to check the AX register, if the AX register is greater than 0 move +1 in BX, if the AX register has a value less than 0 then move -1 in BX else if AX =0 then move 0 in BX. I have the following code that does it but I am looking for an alternate solution. Please help out. Thanks</p>
  
  <pre><code>CMP AX, 0
  JG GREATER
  JL LESS
  MOV BX, 0
  GREATER:
  MOV BX, 1
  LESS:
  MOV BX, -1
  </code></pre>