.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>
These explicitly allow usage of storeimm32 and storeimm64 in the
assembler syntax. It will also warn you if you try to store a value
that's too large using the storeimm32 instruction
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>