A simple LC-3 assembler and simulator in C++.
Only *nix systems are supported currently.
-
g++
to compile -
Development dependencies (for
make test
ormake watch
):lc3as
fromlc3tools
- [
delta
] reflex
(optional)
# Download
git clone https://github.com/dxrcy/lasim lasim
cd lasim
# Compile and install
make
sudo make install
# Assemble and execute a specific file
lasim examples/checkerboard.asm
# Or assemble and execute in separate steps
lasim -a examples/checkerboard.asm -o examples/checkerboard.obj
lasim -x examples/checkerboard.obj
char_count
: Counts the amount of times each letter was inputtedcheckerboard
: Prints an ASCII checkerboardcount_bits
: Counts the '1' bits of an inputted number from 0-9encrypt
: Encrypt/decrypt a message using a Caesar cipherfibonacci
: Caclulates the n-th fibonacci number (no output)hello_world
: Take a wild guess...store_number
: Reads a 5-digit number and stores it in memory (no output)string_array
: Prints an array of static-memory strings
Some of the examples are taken from here and here.
This project only uses the following C++ features (to keep it simple):
- References
- Booleans
nullptr
static_cast
/reinterpret_cast
enum class
std::vector
- Add debugger mode
- Make error messages nicer
- Assemble and run without intermediate write