A simple LC-3 assembler and simulator
A simple LC-3 assembler and simulator in C++.
Only *nix systems are supported currently.
g++
to compile
Development dependencies (for make test
or make watch
):
lc3as
from lc3tools
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 stringsSome of the examples are taken from here and here.
This project only uses the following C++ features (to keep it simple):
nullptr
static_cast
/reinterpret_cast
enum class
std::vector