+ const dictionary = { EXECUTE: 12 }
+ const doesDictionary = {}
+
+ /* Environment functions */
+ const output = {
+ print: (string) => txtoutput.textContent += `\\\ => ${string} \n`
+ }
+ const wasmString = (addr, u) =>
+ String.fromCharCode.apply(
+ null,
+ new Uint16Array(wasmMem.buffer, addr, u >> 1)
+ )
+ const updateViews = () => {
+ const base = new DataView(wasmMem.buffer, 14348 /* base */, 4).getUint32(0,true)
+ stackview.textContent = simstack.map((v) => v.toString(base)).join('\n')
+ // rstackview.textContent = rstack.join('\n')
+ let cnt = 0;
+ const maxBytes = 64
+ let here = new DataView(wasmMem.buffer, 14340 /* here */, 4).getUint32(0,true)
+ memview.textContent = Array.from(new Uint8Array(wasmMem.buffer, here - maxBytes, maxBytes), (v) => {
+ cnt++;
+ v = ('0' + (v & 0xFF).toString(16)).slice(-2)
+ if (cnt === maxBytes)
+ return v
+ if ((cnt % 16) === 0)
+ return `${v}\n=> ${(here -maxBytes + cnt).toString(base)}\n`
+ if ((cnt % 4) === 0)
+ return `${v}\n`
+ return `${v} `
+ }).join('')
+ outframe.scrollTop = outframe.scrollHeight
+ }