COREWAR

/
Step 1: The "STEP" Button That Advances Time
🎯Press [STEP] twice to reach Cycle 2 or higher(0/2)

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 01 OF 30Chapter 1: UI Controls & Memory Architecture⏱ 5 min read
📖 Lecture Note: Computer Science & Artificial Life Principles Behind This Experiment

The Physics of the Program Counter (PC) and Clock Cycles

Even a modern multi-gigahertz CPU is fundamentally just pressing this "STEP" button billions of times per second

#Program Counter (PC)#Clock Cycle#Fetch-Decode-Execute#Instruction Pointer#Deterministic State Machine
🔬Step 1: The "STEP" Button That Advances Time

Welcome to CoreWar! The panel on the left shows memory cells (boxes) inside the computer, lined up in order from top to bottom.

Right now, the top row at Address 0000 is glowing. This is the Execution Pointer (Program Counter / PC), which shows the exact instruction that will run next.

🎯 Your Task (No Editing Needed) You don't need to change any code. Click the [STEP] button in the bottom controller twice and watch the glowing execution pointer move down one row at a time (0000 ➔ 0001 ➔ 0002)!

1. The Glowing Row: What Is the Program Counter (PC)?

In this very first experiment, you clicked the [STEP] button twice at the bottom of the screen and watched the brightly glowing highlight descend one row at a time—from Address 0000 to Address 0001, and finally to Address 0002. That glowing indicator pointing to the exact memory cell about to be executed is visual proof of the single most important register in computer science: the Program Counter (PC), also known in x86 architecture as the Instruction Pointer (IP).

Inside the smartphone or laptop you are using right now sits a Central Processing Unit (CPU) packed with billions of microscopic transistors. Although modern computers appear to perform miraculous feats of real-time graphics, networking, and artificial intelligence all at once, the mechanism at the heart of the processor is astonishingly simple. At any given instant, a CPU core holds a single address number inside its Program Counter register. That number tells the hardware which memory box to open next. Once the instruction inside that box is completed, the CPU increments the Program Counter by one (+1) so that it points to the next sequential row in memory.

[Cycle 0] PC = 0000 ──► [0000] ADD.AB #1, $2   (Execute & PC + 1)
[Cycle 1] PC = 0001 ──► [0001] ADD.AB #1, $1   (Execute & PC + 1)
[Cycle 2] PC = 0002 ──► [0002] DAT.F  #0, #0   (Next up...)

2. The Three-Beat Heartbeat: Fetch, Decode, Execute

Every single time you press the [STEP] button, the virtual machine powering CoreWar—known as MARS (Memory Array Redcode Simulator)—performs the exact same three-stage drama that occurs inside physical silicon processors: the Fetch-Decode-Execute instruction cycle.

Stage One is FETCH: The processor reads the current value of the Program Counter (for example, 0000), reaches into memory cell 0000, and pulls the encoded instruction ("ADD.AB #1, $2") into its internal instruction register. Stage Two is DECODE: The control unit inspects the fetched instruction to figure out what operation is requested and which memory boxes are involved. Here, it recognizes an addition operation ("ADD") that takes the literal value 1 and targets the B-field two rows ahead ("$2"). Stage Three is EXECUTE: The Arithmetic Logic Unit (ALU) performs the addition, updates the target memory cell at Address 0002, and finally advances the Program Counter from 0000 to 0001 so the next cycle is ready to begin.

This complete three-beat sequence constitutes one Clock Cycle. When a modern processor is advertised as running at 3 GHz (gigahertz), it literally means an internal crystal oscillator is pressing this exact [STEP] button three billion times every single second.

3. Discretizing Time: Step Execution and the Science of Debugging

If computers could only run at billions of cycles per second, human beings would have no hope of ever comprehending how programs actually work—or why they fail when a bug occurs. To bridge the massive speed gap between silicon hardware and human perception, computer scientists invented single-step debugging: the ability to freeze the clock and advance time one discrete instruction cycle at a time.

Throughout your journey in this CoreWar vivarium, the [STEP] button will serve as your temporal microscope. Later in the curriculum, you will encounter self-replicating digital organisms, carpet-bombing loops, and deceptive traps that hijack enemy execution pointers. At full speed, their interactions look like a blur of activity. Yet because a Von Neumann computer is a strictly deterministic state machine, freezing time with [STEP] strips away all mystery. By watching where the Program Counter stands and which memory cell changes on each single tick of the clock, you can dissect and master any algorithm ever written.

🔒

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