retd

386 and later

Return from Procedure Call

retd | retd imm16
  • RET, and its exact synonym RETN, pop IP or EIP from the stack and transfer control to the new address. Optionally, if a numeric second operand is provided, they increment the stack pointer by a further imm16 bytes after popping the return address.

  • RETF executes a far return: after popping IP/EIP, it then pops CS, and then increments the stack pointer by the optional argument if present.

No example here: this instruction either stops the program, or belongs to a mode this emulator does not run.

Forms

Every form of retd the assembler accepts, from NASM's own instruction table. The second column is the processor that introduced the form; a badge marks a form that needs an extension, that is lockable, or that long mode dropped.

FormSinceNotes
retd 386nolong
retd imm16386nolong