# `iretd`

[x86-64 Documentation](https://asm-editor.specy.app/documentation/x86.md) › [Instructions](https://asm-editor.specy.app/documentation/x86/instruction.md)

Web page: https://asm-editor.specy.app/documentation/x86/instruction/iretd

**Interrupt return, 32-bit**

Category: System

Returns from an interrupt by popping eip, cs and eflags as 4-byte values, and in 64-bit mode esp and ss as well.

386 and later

[Intel's reference: IRET/IRETD/IRETQ](https://intel.github.io/SDM/instruction/IRET-IRETD-IRETQ.html)

## Flags

| Flag | Effect |
| --- | --- |
| CF | loaded from the stack |
| PF | loaded from the stack |
| AF | loaded from the stack |
| ZF | loaded from the stack |
| SF | loaded from the stack |
| TF | loaded from the stack |
| IF | loaded from the stack. Loaded only when the program has the privilege to change it. A program in the editor does not, so IF keeps its value. |
| DF | loaded from the stack |
| OF | loaded from the stack |

## Forms

- `iretd`

## Description

In 64-bit mode it also pops `esp` and `ss`, 20 bytes in all, and loads only 32-bit `eip` and `esp`, so a 64-bit handler returns with [`iretq`](https://asm-editor.specy.app/documentation/x86/instruction/iretq.md) instead.

## Example

```x86
global _start

section .text
_start:
        mov rax, 12
        mov rbx, 5
        mov rcx, 3
        mov rsi, 9

        iretd

        mov rax, 60         ; syscall 60: exit
        xor rdi, rdi
        syscall
```
