COREWAR

/
ADD - Add
🎯Press [STEP] 3 times to observe the value at 0002 being incremented(0/3)
🟢 EDIT MODE (Click cells to modify)
[Addr][Opcode][A (Left)][B (Right)]
📦 DATA / BOMB (DAT)
+2
0000
+ADD
#
$
0001
↺JMP
$
0002
■DAT
#
#
◎ B-TARGET
0003
■DAT
$0
$0
++ ADD ROW
0004
■DAT
$0
$0
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 (3/19)

ADD - Add

ADD: Add (Arithmetic & Pointer Stepping)

ADD adds the value of operand A to operand B and stores the result in destination B (B = (B + A) mod CORESIZE). It is the primary engine used by bombers and scanners to advance their target pointers across the Core.

Syntax

ADD.AB #step, target   ; Add immediate step to target's B-field
ADD.F  stepCell, ptr   ; Add both A and B fields of stepCell into ptr

Strategic Usage: Stepping Pointers

In the classic Dwarf bomber, ADD increments the bombing pointer by 4 on every loop iteration so bombs land evenly across memory:

loop: ADD.AB #4, bomb   ; Increment bomb's B-field by 4 (0 -> 4 -> 8 -> 12...)
      MOV.I  bomb, @bomb ; Drop DAT bomb at the address stored in bomb
      JMP.A  loop
bomb: DAT.F  #0, #0

Modifiers

  • .AB: Adds source A-value to destination B-value (default when A-mode is #).
  • .B: Adds source B-value to destination B-value.
  • .A: Adds source A-value to destination A-value.
  • .F / .I: Adds both A-fields together and both B-fields together independently (default when A-mode is not #).
📚 REDCODE-94 INSTRUCTION REFERENCE (3/19)

ADD - Add

ADD: Add (Arithmetic & Pointer Stepping)

ADD adds the value of operand A to operand B and stores the result in destination B (B = (B + A) mod CORESIZE). It is the primary engine used by bombers and scanners to advance their target pointers across the Core.

Syntax

ADD.AB #step, target   ; Add immediate step to target's B-field
ADD.F  stepCell, ptr   ; Add both A and B fields of stepCell into ptr

Strategic Usage: Stepping Pointers

In the classic Dwarf bomber, ADD increments the bombing pointer by 4 on every loop iteration so bombs land evenly across memory:

loop: ADD.AB #4, bomb   ; Increment bomb's B-field by 4 (0 -> 4 -> 8 -> 12...)
      MOV.I  bomb, @bomb ; Drop DAT bomb at the address stored in bomb
      JMP.A  loop
bomb: DAT.F  #0, #0

Modifiers

  • .AB: Adds source A-value to destination B-value (default when A-mode is #).
  • .B: Adds source B-value to destination B-value.
  • .A: Adds source A-value to destination A-value.
  • .F / .I: Adds both A-fields together and both B-fields together independently (default when A-mode is not #).