dawpitech / corewar

0 stars 0 forks source link

error handling #19

Open ALittlePatate opened 3 months ago

ALittlePatate commented 3 months ago

my theory: If you compile a C program using GCC, the resulting binary file will be valid. Your processor will execute the binary file, if it finds an unknown instruction, it throws the "illegal instruction" message. If the arguments for the opcodes aren't properly formatted, the CPU will still try to use them and at this point it's undefined behavior.

So the VM should not check everything the compilator checked first. If the compilator used isn't official/outdated/bugged, it's none of our issue.

Proper error messages could be cool to add to the rest of the errors.