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
- Leaves every flag unchanged
Forms
rst 00Pushes the address of the next instruction onto the stack, then jumps to address 00h.
rst 08Pushes the address of the next instruction onto the stack, then jumps to address 08h.
rst 10Pushes the address of the next instruction onto the stack, then jumps to address 10h.
rst 18Pushes the address of the next instruction onto the stack, then jumps to address 18h.
rst 20Pushes the address of the next instruction onto the stack, then jumps to address 20h.
rst 28Pushes the address of the next instruction onto the stack, then jumps to address 28h.
rst 30Pushes the address of the next instruction onto the stack, then jumps to address 30h.
rst 38Pushes 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