what would be the benefit of moving a register to itself in x86-64


March 2019


16 time


I'm doing a project in x86-64 NASM and came across the instruction:

mov rdi, rdi

I have searched all over but can't find mention of why this would be needed. Does it affect the flags or is it something clever that I don't understand? To give some context its present in a loop right before the same register is decremented with sub.


0 answers