📚 REDCODE-94 INSTRUCTION REFERENCE (8/19)
JMP - Jump
JMP: Jump (Unconditional)
JMP transfers execution to the specified address. It is the fundamental control flow instruction in Redcode.
Syntax
JMP target ; Jump to target addressCommon Patterns
Simple Loop
The most basic loop — jump back to the start:
start: ADD #4, ptr
MOV bomb, @ptr
JMP start ; Loop foreverSelf-Jump (Stall)
JMP 0 jumps to itself, creating an immortal but inactive process:
JMP 0 ; Do nothing foreverThis is used in Imp Gates and as a defensive placeholder.
Computed Jump
Jump to a dynamically calculated address:
JMP @ptr ; Jump to address stored in ptrStrategic Notes
- Every bomber needs
JMPto loop its attack cycle JMP 0is the simplest way to keep a process alive- Combined with
SPL, you can create complex multi-threaded control flows - The B-field of
JMPis typically ignored but can store data