How to check whether an integer number is contained in a certain range
Check if it is smaller than
; Check if rax is between 13 and 42
mov rax, 20
cmp rax, 42
jg _no
cmp rax, 13
jl _no
_yes:
; in this branch, we are sure that 13 <= rax <= 42
; ...
_no:
; in this branch, we are sure that rax < 13 or rax > 42
; ...