Let\'s consider the following program, which computes an unsigned square of the argument:
.global foo
.text
foo:
mov %rdi, %rax
mul %rdi
ret
<
In long (64-bit) mode, you return (ret
) by popping a quadword address from the stack to %rip
.
In 32-bit mode, you return (ret
) by popping a dword address from the stack to %eip
.
Some tools like objdump -d
call the first one retq
. It's just a name, the instruction encoding is the same either way (C3
).