COREWAR

/
Step 17: Modifying the Imp (Copy Destination Experiment)
🎯Place a MOV instruction into Cell 0004(0/1)

MISSIONS (30 STEPS)

CH.1: UI & MEMORY BASICS (1-6)
BASIC★☆☆
Step 1: The "STEP" Button That Advances Time
🔒
BASIC★☆☆
Step 2: Process Termination and Restoring with "RESET"
🔒
BASIC★☆☆
Step 3: "Edit Mode" vs. "Running Mode"EDIT
🔒
BASIC★☆☆
Step 4: The Three Rooms of a Memory Box (Changing B)EDIT
🔒
BASIC★☆☆
Step 5: Modifying Both the Left Room (A) and Right Room (B)EDIT
🔒
BASIC★☆☆
Step 6: Literal Numbers (#) vs. Relative Addresses ($)EDIT
CH.2: CORE INSTRUCTIONS (7-13)
🔒
ARITHMETIC★☆☆
Step 7: Observing the "ADD" Instruction
🔒
ARITHMETIC★☆☆
Step 8: Changing the Number to Add (A-Field)EDIT
🔒
ARITHMETIC★☆☆
Step 9: Changing the Target Address (B-Field)EDIT
🔒
ARITHMETIC★☆☆
Step 10: Using the Subtraction Instruction "SUB"EDIT
🔒
BASIC★☆☆
Step 11: Copying an Entire Box with "MOV"EDIT
🔒
CONTROL★☆☆
Step 12: Looping Back in Time with "JMP"EDIT
🔒
CONTROL★☆☆
Step 13: Build Your First Program (Automatic Counter)EDIT
CH.3: VON NEUMANN & DIGITAL LIFE (14-18)
🔒
BASIC★☆☆
Step 14: Why Does "DAT" Become a Bomb?EDIT
🔒
BASIC★☆☆
Step 15: Copying Your Own Instruction (Code = Data)EDIT
🔒
BASIC★☆☆
Step 16: Observation: Stepping Through "Imp", the Oldest Digital Organism
🔒
BASIC★☆☆
Step 17: Modifying the Imp (Copy Destination Experiment)EDIT
🔒
ARITHMETIC★★☆
Step 18: Understanding Indirect Addressing (@ Pointers)EDIT
CH.4: CLASSIC ARCHETYPES (19-24)
🔒
STRATEGY★★☆
Step 19: Observation: Dissecting the "Dwarf" Bomber Step-by-Step
🔒
STRATEGY★★☆
Step 20: Modifying Dwarf (Changing the Bombing Interval)EDIT
🔒
STRATEGY★★☆
Step 21: First Combat: Tune Your Bomb Interval to Destroy the TargetEDIT
🔒
CONTROL★★☆
Step 22: Observation: The "SPL" Split Instruction and Mitosis
🔒
CONTROL★★☆
Step 23: Finding Enemies with Conditional Skip "SEQ / CMP"EDIT
🔒
STRATEGY★★☆
Step 24: Stopping an Imp with a Pre-Decrement "Imp-Gate"EDIT
CH.5: BATTLE EVOLUTION (25-30)
🔒
STRATEGY★★☆
Step 25: [Stone] High-Speed Bomber and Step Size TuningEDIT
🔒
STRATEGY★★☆
Step 26: [Paper] Observing the Self-Replicating Swarm "Mice"
🔒
STRATEGY★★★
Step 27: [Modifying Paper] Tune Clone Dispersal Distance to Overwhelm StoneEDIT
🔒
STRATEGY★★☆
Step 28: [Scissors] Tuning Scanner Stride to Shred PaperEDIT
🔒
STRATEGY★★★
Step 29: [Trap] Abducting Enemy Processes with "Vampire"EDIT
🔒
STRATEGY★★★
Step 30: Graduation Exam: Tune Your Warrior and Win the Final BattleEDIT
🟢 EDIT MODE (Click cells to modify)
[Addr][Opcode][A (Left)][B (Right)]
📦 DATA / BOMB (DAT)
0000
▼MOV
#
$
👈 EDIT
0001
▼MOV
<
<
0002
↺JMN
$
$
0003
❖SPL
@
#
0004
+ADD
#
$
0005
↺JMP
$
$
0006
■DAT
$0
$0
++ ADD ROW
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
📖 LECTURE NOTE // STEP 17 OF 30Chapter 3: Von Neumann Awakening & Digital Life⏱ 4 min read
📖 Lecture Note: Computer Science & Artificial Life Principles Behind This Experiment

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

#Instruction Projection#Remote Code Placement#Spatial Offset#Code Overwrite#Imp-Spiral Seed
🔬Step 17: Modifying the Imp (Copy Destination Experiment)

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.