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
- Changes no flag
Forms
rst 00The current PC value plus one is pushed onto the stack, then is loaded with 0.
rst 08The current PC value plus one is pushed onto the stack, then is loaded with 8.
rst 10The current PC value plus one is pushed onto the stack, then is loaded with 16.
rst 18The current PC value plus one is pushed onto the stack, then is loaded with 24.
rst 20The current PC value plus one is pushed onto the stack, then is loaded with 32.
rst 28The current PC value plus one is pushed onto the stack, then is loaded with 40.
rst 30The current PC value plus one is pushed onto the stack, then is loaded with 48.
rst 38The 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