COREWAR

/
Step 5: Modifying Both the Left Room (A) and Right Room (B)
🎯Set Cell 0000 A-value (left value) to 3(0/3)

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

Two-Operand Architecture: The Dual Roles of the A-Field and B-Field

Why assembly instructions carry two operand slots: the universal grammar of Source (A) and Destination (B)

#Two-Operand ISA#Source vs Destination#A-Field#B-Field#Vector Operations (.F)
🔬Step 5: Modifying Both the Left Room (A) and Right Room (B)

Now let's modify both A (Left Value) and B (Right Value) so you can tell them apart effortlessly! - The left number is A. - The right number is B.

🎯 Your Task At Address 0000, set A (Left Value) to 3 and B (Right Value) to 7, then press [STEP]!

1. The Grammar of Assembly: A (Source) and B (Destination)

In Step 5, you modified both rooms of Address 0000 simultaneously—setting the left-hand A-field to 3 and the right-hand B-field to 7. By doing so, you proved that a single memory cell in CoreWar can hold two independent numerical values at the same time.

Why did the designers of CoreWar equip every memory cell with exactly two operand slots—no more and no less?

In Instruction Set Architecture (ISA) design, the vast majority of fundamental operations are binary operations that act between two entities: "Copy from A to B", "Add A into B", "Subtract A from B", or "Compare A against B". To express these operations cleanly, Redcode (much like x86 assembly in AT&T syntax) adopts a Two-Operand Architecture: - The Left Room (A-Field) represents the SOURCE ("what value" or "where to read from"). - The Right Room (B-Field) represents the DESTINATION ("where to write to" or "which target to modify"). Understanding this left-to-right flow of action (A ➔ B) unlocks the grammar of almost every instruction you will ever write. Even when an instruction only needs one primary input (such as JMP, which jumps to the address in the A-field), the second room (B-field) does not go to waste: clever CoreWar programmers use the unused B-field of a JMP instruction as a free storage pocket to hide a pointer or a decoy value!

       [A-Field : Left Room]          [B-Field : Right Room]
         SOURCE (From / Input)   ───►   DESTINATION (To / Output)
Example:      ADD.AB  #3         ───►         $7
         ("Take literal 3"       ───►   "Add it into cell 7 rows down")

2. Storing Dual Variables in DAT and Vector Operations (.F Modifier)

What makes CoreWar's memory architecture especially fascinating is that even passive data cells (DAT) possess both an A-field and a B-field. When you constructed "DAT.F #3, #7" at Address 0000, you effectively packed a two-element tuple—a 2D vector of numbers (3, 7)—into a single memory address.

Notice the ".F" suffix attached to "DAT.F". In the ICWS-94 specification, ".F" stands for Full (or Both Fields). When an arithmetic instruction like "ADD.F" is executed, the virtual CPU performs two additions in parallel during a single clock cycle: it adds the source A-field to the destination A-field, AND simultaneously adds the source B-field to the destination B-field!

In modern microprocessor design, executing a single instruction across multiple data slots at once is known as SIMD (Single Instruction, Multiple Data) vector processing—the technology behind modern GPU shaders and AI accelerators. Because every CoreWar cell has both an A-room and a B-room, advanced warriors can update two separate bombing pointers in a single cycle using ".F" instructions.

3. Memory Inspection and Precision Engineering

Low-level programming demands absolute precision regarding where data lives. Mixing up the A-field and the B-field in assembly is the equivalent of swapping the "amount of money to transfer" with the "bank account number" in a financial transaction—the program will immediately misfire.

By cleanly setting A to 3 and B to 7 in this exercise, you have mastered the spatial layout of a CoreWar memory word. Notice how each room in the structured editor has its own independent controls and can hold any integer from 0 up to the size of the memory core. In real-world assembly programming, keeping track of which register or operand slot holds the source value and which holds the destination address is a core discipline that prevents catastrophic data corruption. Whenever you read a line of Redcode from now on, train your eyes to read from left to right: first the action (Opcode), then the input or source in Room A, and finally the target or destination in Room B. In the next step, the final piece of Chapter 1 awaits: uncovering the profound difference between the "#" symbol and the "

quot; symbol right next to those numbers.

🔒

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