Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alexaandru/lc3
Followed the www.jmeiners.com/lc3-vm tutorial to implement an LC-3 VM
https://github.com/alexaandru/lc3
lc3 lc3-vm vm
Last synced: 27 days ago
JSON representation
Followed the www.jmeiners.com/lc3-vm tutorial to implement an LC-3 VM
- Host: GitHub
- URL: https://github.com/alexaandru/lc3
- Owner: alexaandru
- License: mit
- Created: 2023-06-28T18:41:27.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-06-30T18:18:57.000Z (over 1 year ago)
- Last Synced: 2024-11-06T01:42:22.461Z (3 months ago)
- Topics: lc3, lc3-vm, vm
- Language: Go
- Homepage:
- Size: 53.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# LC-3 VM in Go
An LC-3 VM implementation as described at https://www.jmeiners.com/lc3-vm.
![2048](2048.png)
## Features
Besides the obvious (running LC-3 programs):
- uses alternate buffer to preserve terminal state;
- hides cursor for a more immersive gaming experience :-)
- graceful shutdown by capturing `Ctrl-C`;
- partial integration testing by running 10 x 1KB, automatically generated images
(using random combinations of `ADD`, `AND`, `LD`, `LDR`, `NOT`, `LDI` and `LEA` opcodes) and
verifying the `CPU` registers at the end (**TODO**: verify memory too);
- loading images at the address specified in the object file, NOT hardcoding PC to
`0x3000`.And just for the fun, since I control the VM anyway ¯\\\_(ツ)\_/¯ a bit of _hacking_:
- allow using arrow keys for input (convert them transparently to `WASM`);
- output nicer box for 2048 using [DEC Line Drawing](https://learn.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences#designate-character-set).## Useful
### Resources:
- https://www.jmeiners.com/lc3-vm/
- https://www.jmeiners.com/lc3-vm/supplies/lc3-isa.pdf
- https://students.cs.byu.edu/~cs345ta/labs/P4-Virtual%20Memory.html
- https://en.wikipedia.org/wiki/Little_Computer_3
- https://www.andreinc.net/2021/12/01/writing-a-simple-vm-in-less-than-125-lines-of-c### Tools:
- https://wchargin.com/lc3web/
- https://www.exploringbinary.com/twos-complement-converter/