Because the cmovgq instruction does not accept an immediate value operand, an approach that would not use another register could be to add the zero value to the stack, use its corresponding address instead of using an immediate value, and then restore the stack pointer.
pushq $0 # push 0 onto the stack
cmpb %r9b, %r8b # compare r9b and r8b
cmovgq (%rsp), %rcx # if r8b > r9b, move zero to rcx
addq $8, %rsp # restore stack pointer
Alternatively, rather than pushing zero to the stack and then restoring the stack pointer, the zero value could be stored elsewhere in memory.
cmpb %r9b, %r8b # compare r9b and r8b
cmovgq zero, %rcx # if r8b > r9b, move zero to rcx
...
.section .rodata
zero:
.quad 0
Rather than using cmovgq, a conditional jump is an alternative approach that would not use another register, and would result in the same behavior (i.e., rcx conditionally set to 0 if r8b > r9b).
cmpb %r9b, %r8b # compare r9 and r8
jle destination # if r8b <= r9b, skip the next line
movq $0, %rcx # if r8b > r9b, move zero to rcx
destination:
...