Assembler has more discrete passes now, but things are kind of bare on
the error message front. But, everything is working as it did
previously, so we can move on to more interesting things.
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
* Preprocessor uses an LRPAR generated lexer and a custom parser to
filter comments and set defines. Includes and conditional compilation
will come next.
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
* compile flag and compile_out argument to the driver allow the program
to be compiled only
* if '-' is supplied to compile_out, it will output to STDOUT instead
* if '-' is supplied to input, it will read from STDIN instead
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
Most everything works, but there's one small bug with the execution
involving jumps - still have to figure that one out.
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
.string, .zstring, .u64, .u32, .u16, .u8 are used before an ImmValue to
determine how the memory should be laid out for that value.
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
* Disassemble structure can be used for dumping an object section
* Assembler position calculation was messing up, causing jump addresses
to be wrong. This is fixed.
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
Major changes inlude:
* Bit the bullet and now instructions have their length hard-coded
* Move from_utf8 object parsing to be done by their objects (instead of
a Parser god object)
* A list of AST sections are assembled into an Object using the new
vm::obj::assemble module.
* Changed the object layout some in the spec, and adjusted code to match
this.
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
* Object layout and parsing are done in the vm::obj module
* Add MemCursor, a wrapper around the std::io::Cursor type for walking
through VM memory
* Add vm::tick module for containing the Vm::tick() method
implementation, since it's pretty big
* Instructions are now variable-sized, and are read lazily,
one-at-a-time directly from memory.
* Add VM runtime error structure
* Probably some other stuff I forgot
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
* StoreImm just uses a u64 instead of u32 - we'll figure out the layout
later
* Jmp implementation added (can't believe I forgot this)
* Add Inst AST item, whose immediates don't have to be a u64 right away
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>