Aligned values are a little funky, because the size of the line can't be
determined without knowing what address we're at. So the
DataLines iterator now takes a start address, so it is able to correctly
calculate alignment padding.
Also, the length of the data section uses the DataLines iterator now so
there isn't a complex re-implementation of the same logic.
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
Cargo is finding more reasons to do unnecessary rebuilds, so I've added
the rerun_except crate to its build.rs as well to ignore .asm files
before recompiling.
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
Lots of null bytes in a row are a common thing, so the instructions
available can't start with a null pair of bytes anymore.
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
* Interrupts require functions being aligned on 64-bit boundaries.
Alignment is now allowed via the .align <intsize> directive, aligning
the current address to a new alignment.
* Datasection iteration doesn't require keeping track of the current
position.
* Rudimentary disassembler for breaking down the contents of an object
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
* Instruction assembler used to use macros for handling source,
dest-source, source-source, etc instructions. It did not have a
source-source implementation, however, so the two source-source
instructions (cmpeq and cmplt) were treated as dest-source. This has
been refactored into some local methods that handle this now.
* Syntax for interrupts and interrupt returns are implemented and appear
to be working
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
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>