A virtual Computer, an Assembler and a Disassembler for the programming game Corewar.
Introduction • Virtual Computer • Assembler • Disassembler • Bonus Features • Installation • License
Core War was inspired by a malicious virus written in the 80’s. To deal with the self-replicating virus, a white hat hacker invented Reaper. It was a virus designed to spread and eliminate the malware. He fought fire with fire.
This inspired A. K. Dewdney to coin the idea for Core War.
The idea was simple. You compete by designing viruses to overtake a computer. You win by protecting your own program and overwriting your opponent's programs. This is all happening on a virtual computer. Think, a simple computer within your computer.
The loading of the champions and the enumeration of each player happens in the command line.
It’s important to remember that the last player will have the first process in the order of execution.
The champions are loaded within the memory so that they can space out evenly their entry points.
At startup, each champion have their initial process at their respective entry point.
The number (id) of the player is generated by the machine or specified at launch, and is given to the champions via the r1 registry of their first process at startup.
So even if the champion has no instructions, it will be able to participate as a contestant with the help of the initial process and the registry r1 which has its player’s id.
The assembler (asm) translates the champion's code to bytecode.
The asm translates the champion into a .cor bytecode file, as usual, but also displays in the standard output, the syntax table with translation of each instruction to the right.
The disassembler takes a .cor bytecode file and translates into a .s assembly file.
- (vm) ncurse’s interface visualizer
- (vm) verbose and formatted output (-v)
- (asm) a detailed syntax table display (-v)
- (asm) beautiful error message when assembling
- (other) disassembler
- (other) org documentation
# Clone this repository
$ git clone --recurse-submodules https://github.com/AndreIglesias/Corewar
# Go into the repository
$ cd Corewar
# Compile the project
$ make