Instruction Projection: Beaming Executable Code Across Memory Space
How copying "$0" to a distant offset projects executable instructions across the arena to seed clones or overwrite enemies
By changing the copy destination (B-address), you can beam a copy of an instruction to any target address. Currently, 0000 is MOV.I $0, $2 (copying itself 2 rows down to 0002), followed by JMP.A $-1.
🎯 Your Task Change the highlighted B (Right Address) of 0000 from $2 to $4 (4 rows down) and press [STEP] to place a MOV instruction into Address 0004!
1. From Crawling Imp to Long-Range Instruction Projector
In Step 16, the classic Imp copied itself ($0) into the immediately adjacent cell ($1), allowing its own Program Counter to step onto the new copy on the very next cycle. In Step 17, you modified row 0000 to read "MOV.I $0, $4"—changing the copy destination from 1 row down ($1) to 4 rows down ($4 = Address 0004).
Notice the structural consequence of this change: because the copy is beamed 4 rows ahead to 0004 while the Program Counter only advances by 1 row to 0001, the pointer can no longer walk directly onto the copy it just made. That is why line 2 ("JMP.A $-1, #0") is present: it keeps the parent process safely looping at 0000–0001 while Row 0000 acts as an "instruction projector", beaming a live executable "MOV" instruction directly into Address 0004! Notice that because the copied instruction at Address 0004 is also "MOV.I $0, $4", if any execution pointer ever steps onto Address 0004 in the future, Address 0004 will immediately project another copy of itself 4 rows further down to Address 0008!
[0000] MOV.I $0, $4 ──(Beams executable MOV code 4 rows ahead!)──┐
[0001] JMP.A $-1, #0 (Parent stays alive in a safe loop) │
[0002] DAT.F #0, #0 (Untouched empty space) │
[0003] DAT.F #0, #0 (Untouched empty space) │
[0004] MOV.I $0, $4 ◄────────────────────────────────────────────┘2. Tactical Significance: Why Beam Code Instead of DAT?
You might ask: "If we want to overwrite a distant cell, why beam a 'MOV' instruction ($0) instead of a 'DAT' bomb?" In CoreWar strategy, projecting executable instructions into distant memory serves two powerful purposes:
First is COLONY CONSTRUCTION (Self-Replication): Advanced replicators (known as "Paper" warriors, which you will master in Chapter 5) reproduce by projecting their own executable instructions (MOV, SPL, JMP) across memory to assemble a complete daughter organism at a distant address before awakening it. Beaming "MOV" into Address 0004 is your first hands-on step toward full organism replication.
Second is BRAINWASHING (Code Injection): If you overwrite an enemy warrior's instruction with a "DAT", the enemy thread simply dies. But if you overwrite an enemy's code with an executable instruction like "MOV" or "JMP" or "SPL", the enemy's own execution pointer will unwittingly execute YOUR injected instruction—wasting its CPU cycles or corrupting its own memory from the inside! In biological virology, this is identical to how a retrovirus injects its own genetic sequence into a host cell's genome, hijacking the host's cellular machinery to execute viral instructions instead of the host's original program.
3. Visualizing Memory Ownership in the Arena
Look at the Arena grid on the right side of the screen after pressing [STEP]. The moment your instruction beamed "MOV.I $0, $4" into Address 0004, Cell 0004 lit up in your warrior's blue team color and displayed an active instruction glyph.
The MARS simulator tracks the ownership and contents of all 800 cells in real time, distinguishing between passive data bombs and active executable code. Notice how projecting an instruction to "$4" (4 cells ahead) also lays the foundation for one of CoreWar's most famous advanced structures: the "Imp-Spiral" (or Imp-Ring). While a standard Imp uses "MOV.I $0, $1" to crawl 1 cell at a time, an N-point Imp-Ring uses instructions like "MOV.I $0, $267" (where 267 * 3 = 801 ≡ 1 mod 800) together with "SPL" so that three distributed Imp points leapfrog each other by 267 cells per cycle—creating an interconnected triangle of self-replicating code that cannot be stopped by a single Imp-Gate! Up to this point, however, our target address ($4) has been static—firing at the exact same box on every loop. How can a 3-line program sweep its fire across the entire arena? In Step 18, we unlock the power of Indirect Pointers (@).
🔒 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.