GenTiradentes/tinyvm — pull request #27 by PaytonTurnage (2014-01-13 03:07:08+00:00)
Title: Implementation for Preprocessor Defines

I've done some work on the defines item in the TODO. It is a big pull request, and I mostly did it this way so that all the changes were easily viewable. I can isolate changes and provide patch files where needed if this fork is to be merged.

Valgrind ~~likes~~ fails to reject it, and a test file is included in programs/tinyvm/preprocessor, linked [here](https://github.com/PaytonTurnage/tinyvm/blob/master/programs/tinyvm/preprocessor/define.vm).

What I've been doing for my tests is

make clean && make DEBUG=yes
valgrind --leak-check=full -v bin/tvmi programs/tinyvm/preprocessor/define.vm

in case recreating those steps is necessary in figuring something out.

I was rather unsure of the decision to make an entirely new structure for storing strings, but my intention, if you like this direction, was to also use it for storing variable names when adding the feature to define bytes, words, and double words.

Thanks ahead of time for taking a look! This has been a fun virtual machine to learn assembly on.