A simple ARM-inspired programming language which runs in JS.
npx jsr add @mapokapo/leo-lang
deno add @mapokapo/leo-lang
bunx jsr add @mapokapo/leo-lang
import { parseProgram } from "@mapokapo/leo-lang"; import Machine from "@mapokapo/leo-lang/machine"; // or in Deno import { parseProgram } from "jsr:@mapokapo/leo-lang@^0.0.1"; import Machine from "jsr:@mapokapo/leo-lang/machine@^0.0.1"; const operations = parseProgram(` ldv r0, #1 ldv r1, #2 add r2, r0, r1 st r2, #0 `); const machine = new Machine(operations); while (true) { if (machine.execute()) { break; } } machine.printRegisterTable(); machine.printFlagTable(); machine.printMemoryTable();
Add Package
deno add jsr:@mapokapo/leo-lang
Import symbol
import * as leo_lang from "@mapokapo/leo-lang";
---- OR ----
Import directly with a jsr specifier
import * as leo_lang from "jsr:@mapokapo/leo-lang";
Add Package
npx jsr add @mapokapo/leo-lang
Import symbol
import * as leo_lang from "@mapokapo/leo-lang";
Add Package
yarn dlx jsr add @mapokapo/leo-lang
Import symbol
import * as leo_lang from "@mapokapo/leo-lang";
Add Package
pnpm dlx jsr add @mapokapo/leo-lang
Import symbol
import * as leo_lang from "@mapokapo/leo-lang";
Add Package
bunx jsr add @mapokapo/leo-lang
Import symbol
import * as leo_lang from "@mapokapo/leo-lang";