Skip to content

reverset/lc3-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

75 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

LC-3-rs

An LC-3 virtual machine, implemented in Rust. Most features are implemented with a couple of exceptions, see Missing Features.

Example Usage

Running a program

cargo run -r --bin lc3-cli --all-features -- run examples/hello2.obj

Progress

Feature Info
Virtual Machine βœ…
Assembler 🚧
Disassembler soonℒ️
C Compiler soonℒ️
  • Assembler is very basic at the moment, not ready yet.

References

Virtual Machine

Instructions

Instruction Implemented
ADD βœ…
AND βœ…
BR βœ…
JMP βœ…
JSR βœ…
JSRR βœ…
LD βœ…
LDI βœ…
LDR βœ…
LEA βœ…
NOT βœ…
RET βœ…
RTI βœ…
ST βœ…
STI βœ…
STR βœ…
*TRAP βœ…
**reserved βœ…

* not all standard TRAP vectors are implemented
** reserved causes an exception when used (which is handled by the OS, and the behavior can be changed by modifying the interrupt vector and/or its implementation)

Other VM features

Feature Status
Interrupts/Exceptions βœ…
*Memory Protection βœ…
Memory Device IO Callbacks for external bindings βœ…
Keyboard status and data register βœ…
Display status and data register βœ…
  • Memory protection relies on how the interrupt is handled. If the default OS is removed, strange behavior may occur if not handled correctly.

Missing features

  • Virtual Machine
    • putsp TRAP vector
    • And maybe a few other things.
  • Assembler
    • Revamp error messages (completely terrible at the moment)
    • Raw output format planned (currently outputs the same format as LC3Tools, without symbols or debug)
    • Linking

About

An LC-3 virtual machine written in Rust. Probably not πŸš€ *blazingly fast* πŸ”₯ though

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors