📚 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 ptrStrategic 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, #0Modifiers
.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#).