title: Invalid combination of opcodes and operands when cmov pointer and register
body: <p>I want to write a piece of code in assembly language, that would change all uppercase characters in a string to lowercase. However, I would like to avoid as many conditional jumps as possible. I tried the following code:</p>
  
  <pre><code>    global tolower_cmov
  
  tolower_cmov:
      enter 0, 0
      mov edx, [ebp + 8]
      xor eax, eax
      xor ecx, ecx
  .back:
      test [edx], byte 0xff
      jz .end
  
      mov eax, [edx]
      mov ecx, [edx]
      add [eax], byte 'a' - 'A'
      cmp [edx], byte 'A'
      cmovb [edx], eax
      cmp [edx], byte 'z'
      cmova [edx],  ecx
  
      inc edx
      jmp .back
  .end:
      leave
      ret
  </code></pre>
  
  <p>But NASM gives me <code>Invalid combination of opcodes and operands</code> error on both CMOV lines... I don't understand, what is wrong with those lines?</p>