rst

Restart

Pushes the return address onto the stack and jumps to a fixed address from 00h to 38h in steps of 8.

1 byte11 cycles

SZHP/VNC ––––––
  • Leaves every flag unchanged

Forms

  • rst 00

    Pushes the address of the next instruction onto the stack, then jumps to address 00h.

  • rst 08

    Pushes the address of the next instruction onto the stack, then jumps to address 08h.

  • rst 10

    Pushes the address of the next instruction onto the stack, then jumps to address 10h.

  • rst 18

    Pushes the address of the next instruction onto the stack, then jumps to address 18h.

  • rst 20

    Pushes the address of the next instruction onto the stack, then jumps to address 20h.

  • rst 28

    Pushes the address of the next instruction onto the stack, then jumps to address 28h.

  • rst 30

    Pushes the address of the next instruction onto the stack, then jumps to address 30h.

  • rst 38

    Pushes the address of the next instruction onto the stack, then jumps to address 38h.

        .org 0x0000
        ret             ; the handler that `rst 00` jumps to
        .org 0x8000
start:  rst 00          ; a one byte call to 0x0000
        halt
        end start       ; without this the program would start at the handler