rst

Restart

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

1 byte · 11 cycles

SZHP/VNC ––––––
  • Changes no flag

Forms

  • rst 00

    The current PC value plus one is pushed onto the stack, then is loaded with 0.

  • rst 08

    The current PC value plus one is pushed onto the stack, then is loaded with 8.

  • rst 10

    The current PC value plus one is pushed onto the stack, then is loaded with 16.

  • rst 18

    The current PC value plus one is pushed onto the stack, then is loaded with 24.

  • rst 20

    The current PC value plus one is pushed onto the stack, then is loaded with 32.

  • rst 28

    The current PC value plus one is pushed onto the stack, then is loaded with 40.

  • rst 30

    The current PC value plus one is pushed onto the stack, then is loaded with 48.

  • rst 38

    The current PC value plus one is pushed onto the stack, then is loaded with 56.

        .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