bit-hack/c-compiler

Support string literals

Opened this issue · 0 comments

It would be good to support string literals. Thats a little more complicated because of the single pass nature of the compiler.

It would be possible however to:

  • Maintain a separate string table in the compiler
  • After parsing append the string table to the code
  • Inject an instruction to set the string table pointer at the start of the code
  • Add an instruction to load a string address, via the string table pointer?

To get the pointers to work out correctly, we might need to start the VM stack after the end of the code and string table?

Then a single pointer can index all address spaces?