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>
* Call/ret/push/pop are implemented and appear to be working
* Call/ret/push/pop is specified in the 0x2000 block, replacing the
mov instruction
* Mov instruction is now specified in the 0x3000 block
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>
* Data section names are encoded in the object file format
* Objects can be converted into their file format layouts
* Add writing/reading test to make sure that an object converted to
bytes and then back from bytes is equal to hopefully catch major
object translations
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
Single-source instructions need their source spec to be in the the top 4
bits of the source/dest spec, and it was incorrectly being set in the
bottom 4 bits. This affected jump instructions, as they would
be reading the instruction at the given address rather than jumping
to it.
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>
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>