TitanHZZ / vm

Simple stack based virtual machine.
MIT License
1 stars 0 forks source link

[Assembly] Preprocessor. #15

Closed TitanHZZ closed 11 months ago

TitanHZZ commented 11 months ago

Add support for preprocessor directives.

TitanHZZ commented 11 months ago

There is now support for very basic preprocessor directives like '%define' and '%include' but there are some limitations with the current system. For example, '%include' does not support the use of code (instructions) inside the included file (the resulting program will have undefined behavior) and '%define'ed statements will only be valid as instruction operands. The current preprocessor implementation will be considered unfinished until at least a proper '%include' is implemented what will most likely require rewriting the entire translation/compilation mechanism. Not closing.

TitanHZZ commented 11 months ago

With the latest commits, the preprocessor got a lot better and now supports code in '%include'ed files. '%define' statements are also better now. Closing.