The Birth of "Imp": Von Neumann's Self-Replicating Automaton and the Logic of DNA
How a single line of code ("MOV.I $0, $1") without even a JMP instruction achieves immortality by paving its own road ahead
The single line you just created—MOV.I $0, $1—is none other than the Imp, CoreWar's oldest and smallest artificial lifeform (created in 1984)!
How can a 1-line program stay alive without a JMP instruction? 1. At 0000, it copies itself ($0) into the next box down ($1 = 0001). 2. On the next cycle, the execution pointer naturally steps down to 0001. 3. Waiting at 0001 is the fresh copy of MOV.I $0, $1 it just wrote!
🎯 Your Task (No Editing Needed) Press [STEP] 5 times (or press [PLAY]) to watch the Imp replicate itself forward to Address 0005!
1. 1984: The World's Smallest Artificial Organism, the "Imp"
In Step 16, you pressed [STEP] five times and watched a single line of code—"MOV.I $0, $1"—march steadily down the memory column from Address 0000 to Address 0005, leaving a glowing trail of identical clones in its wake.
When computer scientist A. K. Dewdney first introduced CoreWar to the world in his May 1984 Scientific American column, this exact one-line program was the very first digital organism he presented. He named it the "Imp".
Pause to appreciate the paradox of the Imp. Back in Chapter 2 (Step 12), we learned that any straight-line program without a "JMP" loop inevitably falls off the end of its code into empty memory ("DAT #0, #0") and dies. The Imp is only ONE line long, and it has no "JMP" instruction anywhere! By all normal rules, after executing Address 0000 on Cycle 1, its Program Counter should step onto Address 0001 on Cycle 2 and crash. How does the Imp cheat death?
Cycle 1 (PC=0000): [0000] MOV.I $0, $1 ──(Copies self to 0001)──► [0001] MOV.I $0, $1
Cycle 2 (PC=0001): [0001] MOV.I $0, $1 ──(Copies self to 0002)──► [0002] MOV.I $0, $1
Cycle 3 (PC=0002): [0002] MOV.I $0, $1 ──(Copies self to 0003)──► [0003] MOV.I $0, $1
"Just before my foot comes down on the next tile, I build the tile in mid-air!"2. Building the Bridge in Mid-Air: Synchronization of "$0, $1" and "PC + 1"
The secret of the Imp's immortality lies in a breathtaking synchronization between three mechanisms: Self-Replication ("MOV.I $0, $1"), the CPU's automatic Program Counter increment ("PC + 1"), and PC-Relative Addressing ("
quot;).Let's trace the miracle microsecond by microsecond: 1. At the start of Cycle 1 (PC = 0000), Address 0001 is an empty, lethal "DAT #0, #0" cell. If the PC stepped there right now, the process would die. 2. During Cycle 1, the instruction at 0000 executes "MOV.I $0, $1", copying itself ($0 = 0000) into the cell immediately ahead ($1 = 0001). Address 0001 is transformed from a lethal DAT into a living "MOV.I $0, $1" instruction! 3. At the end of Cycle 1, the CPU automatically increments the Program Counter by +1 (from 0000 to 0001). 4. On Cycle 2 (PC = 0001), the execution pointer lands squarely on the fresh copy of "MOV.I $0, $1" it just created! And because its operands are relative ($0 and $1), executing "MOV.I $0, $1" from Address 0001 now automatically copies 0001 into 0002!
Like a cartoon train laying down fresh tracks right in front of its own wheels as it speeds forward, the Imp constructs its own future one cycle before stepping into it. In a circular memory core of 800 cells, an undisturbed Imp will lap the entire universe every 800 cycles for eternity.
3. Von Neumann's Self-Replicating Automaton and Biological DNA
Remarkably, in the late 1940s—several years before Watson and Crick discovered the double-helix structure of biological DNA in 1953—John von Neumann had already worked out the mathematical theory of Self-Replicating Automata, asking: "What logical architecture is required for a machine to reproduce itself?"
Von Neumann proved that any self-replicating entity must use its own genetic description in two distinct ways: 1. Uninterpreted Transcription (Code treated as Data): Reading the blueprint passively to copy it into offspring (in biology, DNA polymerase replicating a strand; in the Imp, the "$0, $1" operands copying the cell). 2. Active Execution (Code treated as Instructions): Executing the blueprint to drive the machinery of reproduction (in biology, ribosomes translating genetic code into proteins; in the Imp, the Program Counter executing the MOV instruction).
What took carbon-based biochemistry billions of years to evolve in DNA and RNA is distilled inside the Von Neumann universe into a single crystalline line of Redcode: "MOV.I $0, $1".
🔒 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.