bin+lib lc3-rs

A LC-3(Little Computer 3) virtual machine

12 releases (4 breaking)

✓ Uses Rust 2018 edition

0.5.0 Aug 29, 2019
0.4.3 Jul 15, 2019
0.4.2 Jun 3, 2019
0.3.1 May 22, 2019
0.1.3 May 5, 2019

#7 in Simulation

Download history 23/week @ 2019-07-19 3/week @ 2019-07-26 36/week @ 2019-08-02 25/week @ 2019-08-09 8/week @ 2019-08-16 137/week @ 2019-08-23 47/week @ 2019-08-30 42/week @ 2019-09-06 41/week @ 2019-09-13 95/week @ 2019-09-20 27/week @ 2019-09-27 19/week @ 2019-10-04 2/week @ 2019-10-11 54/week @ 2019-10-18 71/week @ 2019-10-25

194 downloads per month
Used in 2 crates


813 lines


Efficient LC-3 simulator for any platforms, written in pure Rust.
Copyright (C) 2019 Nam Jeonghyun. (ska827@snu.ac.kr)


Currently there is no useful frontends (e.g. benchmarkers, debuggers) is implemented. You can run simple LC-3 calculator which implements this specification with cargo run --bin calc.

Using as a library

You can use lc3::vm to get your code to handle LC-3 instructions. Please refer to docs.

There are two useful optional features for debugging, register-trace and instruction-trace.

If register-trace feature is enabled, pc, ir, register will be printed into stderr after each steps are executed. Note that pc will represent an actual location of the instruction executed(PC is automatically incremented after fetching instructions, therefore self.pc-1), but register values will be printed after the instruction is executed.

If instruction-trace feature is enabled, contents of ir will be printed into stderr as a parsed Instruction enum before the instruction is executed.

Additionally, on Windows, CRLF line endings will be automatically converted into LF. If you prefer not to do this, enable disable-crlf-compat-windows feature when building.


GPLv2, also refer to a copyright notice for embedded lc3os.obj.

No runtime deps