- Assemble and execute assembly of the Little Man Computer instruction set
- Additionally supports comments starting with '
#'
- A compiler supporting
c++-20- Override the default by setting the
CXXenvironment variable, if required
- Override the default by setting the
make: Builds the simulator- Supports multiple threads with
-j[THREAD COUNT] - Use
make -j$(nproc)to build with all available threads
- Supports multiple threads with
make clean: Removes the compiled simulator, if presentDEBUG=[true/false]: Environment variable to enable debug support- Includes debug symbols, retains the frame pointer and uses sanitisers
BUILD_DIR: Environment variable to configure built object output
./simulator [FILE] [MEMORY SIZE]- For example,
./simulator programs/power.asm - Or to limit the memory size to 50,
./simulator programs/power.asm 50
- For example,
- Set
DEBUG="true"as an environment variable, to enable debug outputDEBUG="true" ./simulator [FILE]
- In order of complexity, some sample programs are kept in
programs/:multiply.asm: Multiply 2 inputs togethermodulus.asm: Carry out modular division between 2 inputspower.asm: Raise the first input to the power of the secondtriangular.asm: Output the firstntriangular numbersfibonacci.asm: Output the firstnterms of the Fibonacci sequenceiteration.asm: Iterate over a group of addressesquine.asm: Iterate over the program's instructions to print its own codebinary.asm: Convert an integer from input into 8-bit binaryleapyear.asm: Check if a year from 1 to 999 was a leap year
- Feel free to submit pull requests!
- Contributed code must fit the style of the codebase so far
- Sample assembly is also welcome, as long as it's under
programs/