rozukke / lace

An all-in-one assembler toolchain for the LC3 assembly language.
MIT License
13 stars 1 forks source link
assembler-emulator lc3-assembler rust-lang

lace logo

lace

Build status GitHub release GitHub license Creator rozukke Made with Rust

lace is an all-in-one LC3 (Little Computer 3) assembly toolchain. lace currently supports compiling, checking, running and placing a watch on LC3 assembly files. It will support fancy convenience features like a formatter and (probably) running with a copy of the original OS. Some features are missing!

Commands

Instruction set extension

LC3 is unfortunately limited in terms of functionality, with the absence of a stack being the most painful missing feature. Luckily, LC3 also comes with a spare opcode (0b1101/0xD), which I have used to implement stack-based instructions on top of the existing set. The new instructions are:

Please note that these instructions will only function when using the lace virtual machine and run command.

Traps

There are a few extra traps that should make debugging a lot nicer! Please note that they will not perform as expected when you run your binaries with other virtual machines.

Work in progress

There are several features and fixes under development:

Check the repo for updates as it is under active development.

Installation

For now, please use cargo to get set up, as there are no official releases. Check in often for the latest updates! If you are unsure what cargo is, check out this help page. Alternatively, there is a flake.nix available with a Rust development shell, if you have Nix set up.

To install, follow the steps below:

git clone https://github.com/rozukke/lace.git
cd lace
cargo install --path .

You should, as a result, have the lace binary available in your PATH.

Examples

Some examples are available under the tests/files directory for testing purposes. You can run them with LC3, e.g. lace run tests/files/hw.asm.

Contributors

A huge thank you to @dxrcy for various additions and bugfixes, including continued work on the debugger implementation!

License

Copyright (c) 2024 Artemis Rosman

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.