COREWAR

/
SLT - Skip if Less Than
🎯Press [STEP] twice to observe SLT skipping the next line when A < B(0/2)
🟢 EDIT MODE (Click cells to modify)
[Addr][Opcode][A (Left)][B (Right)]
📦 DATA / BOMB (DAT)
+3
0000
◉SLT
#
$
0001
■DAT
#
#
0002
↺JMP
$
0003
■DAT
#
#
◎ B-TARGET
0004
■DAT
$0
$0
++ ADD ROW
0005
■DAT
$0
$0
0006
■DAT
$0
$0
0007
■DAT
$0
$0
0008
■DAT
$0
$0
0009
■DAT
$0
$0
0010
■DAT
$0
$0
0011
■DAT
$0
$0
0012
■DAT
$0
$0
0013
■DAT
$0
$0
0014
■DAT
$0
$0
0015
■DAT
$0
$0
0016
■DAT
$0
$0
0017
■DAT
$0
$0
0018
■DAT
$0
$0
0019
■DAT
$0
$0
0020
■DAT
$0
$0
0021
■DAT
$0
$0
0022
■DAT
$0
$0
0023
■DAT
$0
$0
0024
■DAT
$0
$0
0025
■DAT
$0
$0
0026
■DAT
$0
$0
0027
■DAT
$0
$0
🏟️ARENA (20 ROWS)SCOPE: 0000 - 0019
[CORE MEMORY 800 CELLS (20 ROWS × 40 COLS)]1:1 Row Synced with Editor
TASKS: 0
CYC: 0
📖REDCODE-94 INSTRUCTION REFERENCE(Drag to move)
📚 REDCODE-94 INSTRUCTION REFERENCE (16/19)

SLT - Skip if Less Than

SLT: Skip if Less Than

SLT compares operand A and operand B as unsigned modular integers (0 to CORESIZE - 1), and skips the next instruction if A is strictly less than B (A < B).

Syntax

SLT.AB #threshold, target ; Skip next instruction if threshold < target.B

Use Cases

Self-Hit Prevention in Scanners

Competitive scanners must avoid bombing their own code. By checking whether the scan pointer falls within a protected range using SLT, a scanner can safely skip over its own body:

scan: ADD.AB #12, ptr
      SLT.AB #20, ptr   ; If 20 < ptr, pointer is safely outside our 20-line body
      JMP.A  scan       ; Otherwise (ptr <= 20), skip attacking ourselves!

Bounded Loops & Phase Switching

Use SLT to switch a warrior from a fast scanning phase into a carpet-bombing core-clear phase once a pointer exceeds a threshold.

Modifiers

  • .AB — Compare source A-value with destination B-value (default when A is #)
  • .B — Compare B-fields (default when A is not #)
  • .A / .F — Compare A-fields, or require both A and B to be less than destination
📚 REDCODE-94 INSTRUCTION REFERENCE (16/19)

SLT - Skip if Less Than

SLT: Skip if Less Than

SLT compares operand A and operand B as unsigned modular integers (0 to CORESIZE - 1), and skips the next instruction if A is strictly less than B (A < B).

Syntax

SLT.AB #threshold, target ; Skip next instruction if threshold < target.B

Use Cases

Self-Hit Prevention in Scanners

Competitive scanners must avoid bombing their own code. By checking whether the scan pointer falls within a protected range using SLT, a scanner can safely skip over its own body:

scan: ADD.AB #12, ptr
      SLT.AB #20, ptr   ; If 20 < ptr, pointer is safely outside our 20-line body
      JMP.A  scan       ; Otherwise (ptr <= 20), skip attacking ourselves!

Bounded Loops & Phase Switching

Use SLT to switch a warrior from a fast scanning phase into a carpet-bombing core-clear phase once a pointer exceeds a threshold.

Modifiers

  • .AB — Compare source A-value with destination B-value (default when A is #)
  • .B — Compare B-fields (default when A is not #)
  • .A / .F — Compare A-fields, or require both A and B to be less than destination