COREWAR

/
Step 2: Process Termination and Restoring with "RESET"
🎯Press [STEP] 3 times to observe process termination on DAT(1/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
👁️ OBSERVATION MODE (Press [STEP])
[Addr][Opcode][A (Left)][B (Right)]
📦 DATA / BOMB (DAT)
0000
▼MOV
#
$
0001
▼MOV
<
<
0002
↺JMN
$
$
0003
❖SPL
@
#
0004
+ADD
#
$
0005
↺JMP
$
$
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
📖 LECTURE NOTE // STEP 02 OF 30Chapter 1: UI Controls & Memory Architecture⏱ 5 min read
📖 Lecture Note: Computer Science & Artificial Life Principles Behind This Experiment

Process Termination (Exceptions) and the Science of Deterministic Reset

Why does a CPU halt when executing raw data, and why is initial-state reproducibility the cornerstone of experimental computer science?

#Process Termination#Illegal Instruction#DAT (Data)#Deterministic Reproducibility#State Reset
🔬Step 2: Process Termination and Restoring with "RESET"

Let's see what happens on the third line (0002), which contains DAT (Data). DAT is simply a storage box for numbers—it is NOT an executable instruction.

When the execution pointer tries to execute a DAT cell, the process terminates (crashes). Also, once time advances past Cycle 0, the editor locks into 🔒 Running Mode. Pressing the [RESET] button rewinds time back to Cycle 0 so you can edit again anytime!

🎯 Your Task (No Editing Needed) Press [STEP] 3 times until the pointer executes DAT on line 3 and displays the 💥 Process Terminated badge!

1. The Non-Executable "DAT" Cell and Process Death

In Step 2, pressing the [STEP] button three times marched the Program Counter from 0000 to 0001 and into 0002. The moment the processor attempted to execute "DAT.F #0, #0" at Address 0002, the simulation halted and displayed the "Process Terminated" badge.

Why did the program survive the "ADD" instructions on the first two lines, only to die instantly upon touching "DAT"? The answer lies in the meaning of "DAT", which stands for Data. In a Von Neumann computer, active instructions (like ADD or MOV) and passive numerical variables (DAT) reside side by side in the exact same array of memory boxes. While a human looking at the editor can see that line 3 is meant to hold data, the Program Counter has no such intuition—it blindly advances to 0002 and hands the contents of that box to the instruction decoder.

When the decoder opens a DAT cell, it finds no valid operation to perform. In physical CPUs such as x86-64 or ARM, attempting to decode non-instruction bytes triggers a hardware fault known as an Illegal Instruction Exception (which the operating system translates into a fatal SIGILL signal, terminating the process). In CoreWar, this exact hardware fault defines mortality: any execution pointer that steps onto a DAT cell is immediately destroyed.

[0000] ADD.AB #1, $2   ──► Valid Opcode (ALU executes addition)
[0001] ADD.AB #1, $1   ──► Valid Opcode (ALU executes addition)
[0002] DAT.F  #0, #0   ──► Non-Executable Data! ➔ 💥 Hardware Exception (Process Killed)

2. Why Memory Mutates During Execution: Side Effects and State

As you stepped through the program, you also witnessed the B-value at Address 0002 mutate from 0 to 1, and then from 1 to 2. Executing a program is not a passive reading activity; instructions actively alter the contents of memory. By Cycle 2, the memory space is no longer in its original state.

Imagine what would happen if a programmer edited source code mid-execution while memory values were already half-modified. You would never know whether your program's behavior was caused by your new code or by leftover mutations from earlier cycles. To preserve experimental integrity, the simulator locks the editor into Running Mode (🔒) the moment Cycle 1 begins, ensuring that every change in memory is strictly the result of your program's own instructions. In functional programming and concurrency theory, isolating an active computation from arbitrary external mutation is essential for reasoning about state transitions: when the clock is ticking, the only legal state transitions are those defined by the transition function of the virtual machine itself.

3. Deterministic Machines and Reproducibility via RESET

How, then, do we iterate and improve our code after a process crashes? That is the vital role of the [RESET] button.

Pressing [RESET] rewinds the simulation clock back to Cycle 0, wipes away every runtime memory mutation, restores your initial source code cleanly into memory, and unlocks Edit Mode. In computer science, a system where the exact same initial state and inputs always produce the exact same sequence of future states is called a Deterministic Machine.

In a wet-lab biology experiment, if an organism perishes, you cannot simply rewind time to resurrect the exact same cell. In a digital vivarium, however, time is completely reversible. Pressing [RESET] gives you infinite reproducibility: you can test a hypothesis, watch your process crash into a DAT cell, rewind to Cycle 0 in a millisecond, tweak a single number, and run the experiment again. Never fear crashing your process—in computer science, every crash is a reproducible data point that teaches you how the underlying state machine operates. Modern software engineering tools such as time-travel debuggers (like rr and Replay) and virtual machine snapshots are built on this exact principle of deterministic state restoration.

🔒

🔒 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.