Create assembler driver script for recording word addresses
This commit is contained in:
16
words.js
Normal file
16
words.js
Normal file
@@ -0,0 +1,16 @@
|
||||
import { Assembler } from "./asm.js";
|
||||
|
||||
const asm = new Assembler();
|
||||
for await (const chunk of Deno.stdin.readable) {
|
||||
asm.push(chunk);
|
||||
}
|
||||
asm.wasm();
|
||||
|
||||
const defs = Object.entries(asm.defs);
|
||||
while (defs[0][0] != '_DUP')
|
||||
defs.shift();
|
||||
while (defs.at(-1)[0] != 'WNF_HANDLER')
|
||||
defs.pop();
|
||||
const words = Object.fromEntries(defs.filter(([k,v]) => !k.startsWith("_")));
|
||||
|
||||
console.log(JSON.stringify(words));
|
||||
Reference in New Issue
Block a user