To build, run
make
in the base directory.
To run the VM, run
./lc3.pls [path] [swap_endianness]
path
: relative or abolute path to input binary code using forward slashes.swap_endianness
: whether to swap byte order during loading of binary image. Acceptable values are TRUE or FALSE. Should typically be TRUE.
To run the Assembler, run
./assembler.pls [path] [swap_endianness]
path
: relative or abolute path to input LC3 assembly code file using forward slashes.swap_endianness
: whether to swap byte order during writing of binary image. Acceptable values are TRUE or FALSE. Should typically be TRUE.
As per the LC3 standard, SEMICOLON marks a comment. Comments can be on a line by themselves or after an instruction.
Tokens can be seperated by any combination of TAB, SPACE or COMMA.
Labels may be placed on the same line as an instruction or alone on the line above it. Labels are not case sensitive. LOOP is regarded as the same as Loop/lOOp/loop and so on. BLKW is not implemented. The following macros are valid for use with the assembler: Requires an argument in hex format. (e.g. x3000) .FILL will accept an argument of either a literal value in either hex format (x123), LC3 decimal (#123) or decimal literals (123). .FILL also accepts an argument of a label. In this case, this will resolve to the position in memory of the label. (e.g. 0x3000 + label line index) .STRINGZ takes an argument enclosed by double quotes. Semi-colons inside of STRINGZ arguments are not culled as comments. The escape characters ESC \e) and NEWLINE (\n) are replaced with their actual ASCII values. Other escape codes unsupported. .END marks the end of the file. All text is stripped past the .END before any interpretation occurs.