title: Assembly less than
body: <p>Im trying to recreate a "less than" function in AMD64 assembly.</p>
  
  <p>Like in this case I wanna return 1 if the parameter in %rdi is less then 3.</p>
  
  <pre><code>        .globl f
          .type f, @function
  f:
          xor %rax, %rax
          movq %rdi, %r10
          cmpq $3, %r10
          cmovlq $1, %rax
          ret
  </code></pre>
  
  <p>I have never used cmov before, and I am not sure if I am using it the right way. I get the following error:</p>
  
  <p><code>Error: suffix or operands invalid for cmovl</code></p>
  
  <p>Can anyone help me out here?</p>