Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dxrcy/lasim
A simple LC-3 assembler and simulator
https://github.com/dxrcy/lasim
assembly compiler lc3
Last synced: 25 days ago
JSON representation
A simple LC-3 assembler and simulator
- Host: GitHub
- URL: https://github.com/dxrcy/lasim
- Owner: dxrcy
- Created: 2024-09-05T11:59:23.000Z (2 months ago)
- Default Branch: master
- Last Pushed: 2024-09-23T02:15:09.000Z (about 2 months ago)
- Last Synced: 2024-09-30T05:43:29.027Z (about 1 month ago)
- Topics: assembly, compiler, lc3
- Language: C++
- Homepage:
- Size: 234 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# **LASIM** : LC-3 Assembler & Simulator
A simple [LC-3](https://en.wikipedia.org/wiki/Little_Computer_3) assembler and
simulator in C++.# Usage
> Only *nix systems are supported currently.
- `g++` to compile
- Development dependencies (for `make test` or `make watch`):
- [`lc3as` from `lc3tools`](https://github.com/chiragsakhuja/lc3tools)
- [`delta`]
- [`reflex`](https://github.com/cespare/reflex) *(optional)*```sh
# 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
```# Examples
- `char_count`: Counts the amount of times each letter was inputted
- `checkerboard`: Prints an ASCII checkerboard
- `count_bits`: Counts the '1' bits of an inputted number from 0-9
- `encrypt`: Encrypt/decrypt a message using a Caesar cipher
- `fibonacci`: 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](https://github.com/Nguyen-Nhat-Tuan-Minh/LC_3-Assembly-Program) and
[here](https://github.com/dideler/LC-3-Programs).# C++ Subset
This project only uses the following C++ features (to keep it simple):
- References
- Booleans
- `nullptr`
- `static_cast`/`reinterpret_cast`
- `enum class`
- `std::vector`# Features to Implement
- [ ] Add debugger mode
- [ ] Make error messages nicer
- [ ] Assemble and run without intermediate write