0x0584/corewar

parse asm file

Closed this issue · 0 comments

  • read all file lines and store them in a list
  • fetch which operation from g_op[]
  • loop over arguments fetching their types
  • set encoding in op->info
    • read value following a string with delimiter SEPARATOR_CHAR
    • if value has a T_LAB loop over it after writing operations
  • write op_lst using write_op() which takes each operation and writes into g_champ.file
  • compute prog_size and write header
  • loop over labels replacing each argument with that has a T_LAB flag set into address within g_champ.file
  • append g_champ.file into the header