██████╗ ██████╗ ██████╗ ███████╗██╗ ██╗ █████╗ ██████╗
██╔════╝██╔═══██╗██╔══██╗██╔════╝██║ ██║██╔══██╗██╔══██╗
██║ ██║ ██║██████╔╝█████╗ ██║ █╗ ██║███████║██████╔╝
██║ ██║ ██║██╔══██╗██╔══╝ ██║███╗██║██╔══██║██╔══██╗
╚██████╗╚██████╔╝██║ ██║███████╗╚███╔███╔╝██║ ██║██║ ██║
╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝ ╚══╝╚══╝ ╚═╝ ╚═╝╚═╝ ╚═╝
––– Executing instructions since 2020 –––
This project is a replica of the computer game Core War, launched in 1984.
In this project our assignment was:
- Do a assembler to compile custom assembler code (AKA. Champions) to bytecode.
- Do a VM to execute instructions and oversee the game.
- Do our own Champion.
The last player to stay alive wins!
Execute instructions :))
Compile custom assembly code (Redcode)
Build all
$ make
Build asm (Assembler)
$ make asm
Build corewar (VM)
$ make corewar
Clean .o files and clutter
$ make clean
Clean all
$ make fclean
How to run VM
$ ./corewar champion_file.cor ... <champion_file_4.cor>
Corewar can handle 1 to 4 champions at a time.
Additional options for VM:
-lldfix
: Reference corewar's lld only reads 2 bytes, and this flag fixes that bug.-dump <cycle>
: Dump memory to stdout 32 octets / line and exit the game.-prettydump <cycle>
: Dump memory to stdout 64 octets / line fancier and exit the game.-n <nb> champion_file_2.cor
: Override champion execution order by giving a champion a custom number.
How to run ASM
$ ./asm champion_file.s