lc3

command module
v0.0.0-...-0d836e2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 30, 2023 License: MIT Imports: 6 Imported by: 0

README

LC-3 VM in Go

An LC-3 VM implementation as described at https://www.jmeiners.com/lc3-vm.

2048

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.

Useful

Resources:
Tools:

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL