TECHNICAL GUIDE 01 // ICWS-94 ARCHITECTURE
Inside the MARS Virtual Machine & Redcode-94 Specification
The battlefield of CoreWar—known as the Core—is powered by a virtual processor called MARS (Memory Array Redcode Simulator). Under the standard ICWS-94 ruleset, the Core consists of 8,000 contiguous memory cells (addresses 0 through 7999). All arithmetic and pointer evaluations wrap around modulo 8,000, forming a seamless circular ring where address -1 maps to 7999.
Unlike conventional CPUs, every address in Redcode is strictly relative to the currently executing instruction (Program Counter). Because there are no absolute addresses, all Redcode programs are inherently Position-Independent Code (PIC)—meaning a warrior can copy itself anywhere in memory and continue running without relocation tables. Furthermore, ICWS-94 introduces seven instruction modifiers (.A, .B, .AB, .BA, .F, .X, .I), allowing programmers to target specific operand fields or copy entire instructions at once.
TECHNICAL GUIDE 02 // ADVANCED WARRIOR ENGINEERING
Advanced Tactical Engineering: Modulo Step Mathematics & Imp Spirals
When engineering a Stone bomber or a Scanner, choosing the optimal pointer step size is a mathematical art. In an 8,000-cell core, a naive step of 8 or 10 leaves wide gaps where small enemy loops can hide indefinitely. Competitive warriors use mathematically derived step constants (such as 2365, 3039, or 3359) that maximize worst-case coverage density across the core before repeating modulo cycles.
At the opposite end of the spectrum lies the Imp-Spiral (or Imp-Ring). While a standard 1-point Imp (MOV 0, 1) dies as soon as its lead instruction is bombed, a 3-point Imp-Spiral executes MOV.I 0, 2667 across three interleaved processes (since 2667 * 3 = 8001 ≡ 1 mod 8000). Because the three points continuously feed instructions to one another across the core, standard DAT bombers cannot kill them; defeating an Imp-Spiral requires a dedicated Imp-Gate (such as JMP 0, <-2) that shreds incoming instructions every single cycle.