# `im`

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

Web page: https://asm-editor.specy.app/documentation/z80/instruction/im

**Set interrupt mode**

Category: System

Selects interrupt mode 0, 1 or 2, which sets how the CPU responds to maskable interrupts.

2 bytes · 8 cycles

## Flags

| Flag | Effect |
| --- | --- |
| S | not changed |
| Z | not changed |
| H | not changed |
| P/V | not changed |
| N | not changed |
| C | not changed |

## Forms

- `im 0` · Sets interrupt mode 0.

- `im 1` · Sets interrupt mode 1.

- `im 2` · Sets interrupt mode 2.

## Example

```z80
        .org 0x8000
        im 0
        halt
```
