From 4719f509254bed7f391351b5e18e03e3a80ff891 Mon Sep 17 00:00:00 2001 From: Oleksandr Kozachuk Date: Wed, 8 Apr 2026 10:32:38 +0200 Subject: [PATCH] Remove accidentally committed test files --- test.fth | 2 -- test_js.html | 18 --------------- test_js.js | 63 ---------------------------------------------------- 3 files changed, 83 deletions(-) delete mode 100644 test.fth delete mode 100644 test_js.html delete mode 100644 test_js.js diff --git a/test.fth b/test.fth deleted file mode 100644 index 30efda5..0000000 --- a/test.fth +++ /dev/null @@ -1,2 +0,0 @@ -: SQUARE DUP * ; -7 SQUARE . CR diff --git a/test_js.html b/test_js.html deleted file mode 100644 index c7f87c4..0000000 --- a/test_js.html +++ /dev/null @@ -1,18 +0,0 @@ - - - - - WAFER - test_js.wasm - - - -

WAFER Output

-
- - - - diff --git a/test_js.js b/test_js.js deleted file mode 100644 index bc57a3d..0000000 --- a/test_js.js +++ /dev/null @@ -1,63 +0,0 @@ -// WAFER JS Loader - generated by wafer build --js -// Loads and runs test_js.wasm in the browser. - -const WAFER = (() => { - const CELL_SIZE = 4; - const DATA_STACK_TOP = 0x1540; - const SYSVAR_BASE = 0x0004; - let outputCallback = (s) => { - const el = document.getElementById('output'); - if (el) el.textContent += s; - else console.log(s); - }; - - async function run(opts) { - if (opts && opts.output) outputCallback = opts.output; - - const memory = new WebAssembly.Memory({ initial: 16 }); - const dsp = new WebAssembly.Global({ value: 'i32', mutable: true }, 5440); - const rsp = new WebAssembly.Global({ value: 'i32', mutable: true }, 9536); - const fsp = new WebAssembly.Global({ value: 'i32', mutable: true }, 11584); - const table = new WebAssembly.Table({ element: 'anyfunc', initial: 256 }); - - function emit(code) { - outputCallback(String.fromCharCode(code)); - } - - const importObject = { - env: { emit, memory, dsp, rsp, fsp, table } - }; - - // Register host functions - const view = () => new DataView(memory.buffer); - const pop = () => { - const sp = dsp.value; - const v = view().getInt32(sp, true); - dsp.value = sp + CELL_SIZE; - return v; - }; - const push = (v) => { - const sp = dsp.value - CELL_SIZE; - view().setInt32(sp, v, true); - dsp.value = sp; - }; - - table.set(84, new WebAssembly.Function({parameters:[], results:[]}, () => { - const n = pop(); - const base = view().getUint32(SYSVAR_BASE, true); - outputCallback((base === 16 ? n.toString(16).toUpperCase() : n.toString()) + ' '); - })); - - const response = await fetch('test_js.wasm'); - const bytes = await response.arrayBuffer(); - const { instance } = await WebAssembly.instantiate(bytes, importObject); - - if (instance.exports._start) { - instance.exports._start(); - } - - return instance; - } - - return { run }; -})();