The syscaps are yanked from <https://playful-crisp-e8c688.netlify.app/> (which is itself a remix of the triplescripts.org lines.app.htm demo) and then modified. This works well enough to run on the data located at tests/bs/256.bin.
24 lines
548 B
Plaintext
24 lines
548 B
Plaintext
import { XXD } from "./src/XXD.src"
|
|
|
|
import { SystemB } from "./src/SystemB.src"
|
|
import { SystemC } from "./src/SystemC.src"
|
|
|
|
void function main() {
|
|
if (!system) var system = SystemA.init(SystemB);
|
|
if (!system) var system = SystemA.init(SystemC);
|
|
|
|
if (!system) {
|
|
throw new Error("Unknown environment");
|
|
}
|
|
|
|
system.setUpForExec({
|
|
run: function(system, path) {
|
|
return system.read(path).then((contents) => {
|
|
let xxd = (new XXD(contents));
|
|
xxd.exec();
|
|
system.print(xxd.output);
|
|
});
|
|
}
|
|
});
|
|
} ()
|