/Corewar

Primary LanguageAssembly

corewar

École 42 assignment in C - assembler and virtual machine of Corewar game (in 42's style)

About this project

  • This is a group project of École 42
  • My group consists of 4 people. My teammate are fxbabin, arobion, nendek.
  • The objective of this project is to create an assembler, a virtual machine and a simple champion for Corewar game.

What is Corewar game

  • It's a battle royale of champions. The objective of the game is to be the last champion that is alive in the arena.
  • A champion has a set of instructions that will run when the game start. The champion file is .s type. champion
  • An assembler will comply a champion into a byte code or .cor type. bytecode
  • A virtual machine will run the game
    • receiving .cor files
    • placing each heroes in the memory
    • read byte codes, interpret them and run them if it's valid
    • run the game until there is a winner virtual machine

How to run the program

  • Run Makefile to create executable files: "asm" and "corewar"
    make
    
  • Assembler
    ./asm [champion.s]
    
  • Virtual machine
    ./corewar [-dump N || -v] [-n N] <champion1.cor> <...>
    
    • without flag
      • output
    • flag dump - will show the memory of stated cycle
      • flag_dump
    • flag n - will change the player number
      • flag_n
    • flag v - will visualize the virtual machine
      • flag_v

Contributions

  • [nkamolba]
    • assembler - instructions/labels parsing and writing
    • vitual machine - instuction executions
  • fxbabin
    • assembler - name/comment parsing and writing
    • virtual machine - visualization
  • arobion
    • virtual machine - processing
    • virtual machine - instruction executions
    • create simple champion
  • nendek
    • virtual machine - processing
    • virtual machine - visualization