Why is cmp $ 0xffffffffffffffff% edi used in assembly?

While I was studying assembly code, I saw a code segment below. I am a bit confused.

mov $0x0, %ecx lea 0x3(%rdi), %eax cmp $0xffffffffffffffff, %edi ; ??? cmovle %eax, %rdi 

I highlighted the line. I do not understand why this line is used in assembler?

build: x86 64 bit

EDIT: I have no comparison in my code. For this reason, I wonder why?

Note. I did not find an appropriate title for this question. help and let me know if you find him. So i can change

+4
source share
1 answer

it compares the %edi with the constant $0xffffffffffffffff , which is actually the -1 constant

+3
source

Source: https://habr.com/ru/post/1379259/


All Articles