The Fate of Von Neumann Machines and "DAT Bombs": Why Modern CPUs Need Data Execution Prevention (DEP / NX)
How storing code and data in the same memory space gives rise to both CoreWar DAT bombs and real-world buffer overflow exploits
In Chapter 3, we uncover the secret of Von Neumann Architecture—the foundation of all modern computers. In a Von Neumann machine, instructions and data (DAT) live together in the exact same memory space.
What happens if the JMP instruction on line 2 is overwritten or removed? The execution pointer falls straight into the DAT box on line 3 and dies! In CoreWar, dropping a DAT cell onto an enemy's code turns data into a lethal "Data Bomb" that kills any process that steps on it!
🎯 Your Task Change the Opcode on row 0001 from JMP to ADD to remove the loop, then press [STEP] 3 times to crash the pointer into DAT at 0002!
1. Von Neumann's Revolution: The Light and Shadow of Stored-Program Computers
Opening Chapter 3, Step 14 asked you to conduct a controlled crash experiment: by replacing the "JMP" instruction on row 0001 with "ADD", you removed the protective loop and watched the Program Counter plunge straight into the "DAT" cell at Address 0002, terminating the process.
In 1945, mathematician John von Neumann and his colleagues drafted the landmark "First Draft of a Report on the EDVAC", establishing the architectural blueprint for virtually every modern computer: the Stored-Program Concept (Von Neumann Architecture). Its defining principle is radical simplicity: executable instructions (Code) and passive numerical values (Data) are stored together, indistinguishable from one another, inside the exact same memory array.
Before Von Neumann, reprogramming a machine like ENIAC required technicians to physically unplug and rewire hundreds of patch cables. Storing programs inside memory alongside data made computers infinitely flexible. Yet that same unification introduced an inescapable vulnerability: what happens if the Program Counter loses its way and attempts to execute a memory address that contains raw data instead of valid code?
Von Neumann Unified Memory Space:
[0000] ADD.AB #1, $2 (Code) ──► Executed by CPU
[0001] ADD.AB $-1, #0 (Code) ──► Loop broken! PC falls through...
[0002] DAT.F #0, #0 (Data) ◄── 💥 CPU tries to execute Data ➔ CRASH!2. Why Passive Data ("DAT") Becomes a Lethal Weapon
Notice that the Redcode instruction set contains no "FIRE_MISSILE" or "ATTACK" instruction. Every instruction—MOV, ADD, SUB, JMP—is just a standard tool for moving data and doing math. How, then, do programs fight to the death in CoreWar?
They weaponize the Von Neumann architecture itself. As your experiment just demonstrated, if a process's control flow is disrupted or if a "DAT" cell is placed directly in the path of its Program Counter, the process crashes the instant it steps onto that data cell.
Now imagine using the "MOV" instruction to hurl a copy of a harmless "DAT #0, #0" box across the Arena so that it lands directly on top of an enemy warrior's code. The destructive write erases the enemy's instruction and replaces it with "DAT". When the enemy's execution pointer arrives at that line on its next cycle, it attempts to execute the DAT cell and self-destructs! In a Von Neumann universe, passive data dropped onto active code becomes a lethal landmine—a "DAT Bomb".
3. Real-World Buffer Overflows and Modern Hardware Defenses (DEP / NX Bit)
This exact mechanism—overwriting memory adjacent to or inside an execution path with raw data—is not just a game mechanic. It is the exact foundation of the most famous vulnerability class in real-world cybersecurity: the Buffer Overflow Attack.
In languages like C and C++, if a program receives input data (such as a network packet or text string) without strictly checking its length, the excess data spills over the boundaries of its designated data buffer and overwrites neighboring control data (such as the function return address on the stack). When the CPU tries to jump back from the function, its Program Counter is redirected straight into the overwritten data—either crashing the software (a Denial-of-Service attack, just like a CoreWar DAT bomb!) or tricked into executing malicious machine instructions hidden inside the input data (Remote Code Execution, pioneered by the infamous 1988 Morris Worm).
To defend against this fundamental quirk of Von Neumann architecture, modern processors (Intel, AMD, ARM) and operating systems implement a hardware security feature known as DEP (Data Execution Prevention) or the NX Bit (No-eXecute bit, also called W^X: "Write XOR Execute"). Hardware page tables mark memory regions as either writable data OR executable code, never both at once. In the wild, lawless Von Neumann universe of CoreWar, however, there is no NX bit—every cell is both writable and executable, turning data into bombs and code into living clay.
🔒 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.