lc3asm
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

lc3asm.js

An assembler for Little Computer 3 (LC-3).

Installation

$ npm install lc3asm.js

Running

$ lc3asm <inputfile>.asm

This will generate inputfile.obj and inputfile.sym with the resulting object code and symbols respectively.

API

import Assembler from "lc3asm";

const asm = new Assembler(`
.orig 0
.fill 0
.end`, "filename"); // May throw a Peggy syntax error

asm.symbols(); // Returns a string
asm.object(); // Returns a Uint8Array

Syntax errors have a format() function that will generate nice output:

catch (e) {
  if (typeof e.format === "function") {
    console.error(e.format([{
      source, // must match what was passed to the Assembler constructor
      text,   // The text associated with that file
    }]));

Node.js CI codecov

Package Sidebar

Install

npm i lc3asm

Weekly Downloads

0

Version

0.0.1

License

MIT

Unpacked Size

95.1 kB

Total Files

8

Last publish

Collaborators

  • hildjj