Controlling the Additive Delta (A-Operand) and Step-Size Engineering
How tuning the source operand in an addition instruction controls rate of change and spatial stride
In an ADD instruction: - A (Left Value) specifies how much to add (the number). - B (Right Value) specifies which box to add it to (the address).
Right now, 0000 is ADD.AB #1, $1, which only adds 1 to the box below (initially 0).
🎯 Your Task Change the highlighted A (Left Value) of 0000 from #1 to #5, then press [STEP] so Cell 0001's B-value becomes 5!
1. The A-Field as the Rate of Change (Delta)
In Step 8, you edited the left-hand value (A-field) of "ADD.AB #1, $1" at Address 0000, changing it from #1 to #5. When you pressed [STEP], the data box at Address 0001 jumped directly from 0 to 5 in a single clock cycle.
In mathematics and physics, the amount by which a variable changes per unit of time is denoted by the Greek letter Delta (Δ). In a Redcode instruction of the form "ADD.AB #Δ, $Target", the immediate value stored in the left-hand A-field is literally that Delta: it dictates the magnitude of change applied in a single tick of the processor clock.
When A is set to #1, the target variable advances by one unit per cycle. By changing A to #5, you multiplied the rate of change fivefold without consuming any additional CPU cycles. In numerical analysis and physics simulations, choosing the step size Δ is a fundamental design decision: a small Δ yields fine-grained precision at the cost of requiring many more iterations, whereas a large Δ covers vast distances rapidly. Throughout CoreWar, tuning this single A-field constant lets you dial your warrior's velocity up or down at will.
Before: ADD.AB #1, $1 ──► 1 Cycle = +1 increment (Slow linear step)
After : ADD.AB #5, $1 ──► 1 Cycle = +5 increment (5x stride in the same 1 cycle!)2. Constant-Time Hardware Addition: Why Adding 5 Takes the Same Time as Adding 1
When a human counts on their fingers, adding 5 takes five times longer than adding 1. Even in mental arithmetic, adding large numbers like 388 + 253 takes noticeably more effort than adding 0 + 1. Inside a CPU's Arithmetic Logic Unit, however, adding #1, adding #5, or adding #799 all take the exact same amount of time: one single clock cycle.
This is because hardware adders (such as carry-lookahead adders in silicon, or modular arithmetic units in MARS) process all bits of the number simultaneously in parallel logic gates. In computer science complexity theory, this is known as an O(1) (constant-time) operation.
In CoreWar, where every clock cycle is a matter of life and death, the fact that any additive delta costs only 1 cycle is a cornerstone of tactical engineering. Later, when you build bombers (Dwarf) and scanners (Scissors), this exact A-field number will become your "stride parameter"—controlling whether your warrior tiptoes across memory 1 cell at a time or leaps across the arena 8 cells per bound.
3. The Interplay Between Code Constants and Memory Variables
Look again at the two lines of your program: "ADD.AB #5, $1" and "DAT.F #0, #0". The "#5" inside line 1 is an Immediate Constant embedded directly inside the instruction code. Meanwhile, the B-field of the DAT cell on line 2 acts as a Mutable Variable—a storage container whose value changes as the program runs.
Every algorithm in computer science is built from this partnership between constants encoded in instructions and mutable variables stored in memory. In compiled languages like C or Java, when you write a statement such as "counter += 5;", the compiler embeds the literal constant 5 directly into the machine instruction's immediate field while allocating a separate memory address for the variable "counter". That is why changing the A-field from #1 to #5 felt like tuning a throttle knob: the instruction itself remains static throughout execution, while the data cell below it absorbs the energy of the addition and changes state. Next, in Step 9, we will keep our constant (#5) fixed and learn how to redirect where that energy lands by changing the target address in the B-field.
🔒 MISSION CLEAR Unlocks the Full Lecture Note
Complete the experiment in the simulator above to automatically unlock the full deep-dive article—or click below to read the full text immediately.