@asm198x/z80 0.1.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/asm198x_web.d.ts +19 -0
- package/asm198x_web.js +33 -0
- package/asm198x_web_bg.wasm +0 -0
- package/package.json +1 -1
package/asm198x_web.d.ts
CHANGED
|
@@ -19,6 +19,24 @@ export function assemble(dialect: string, source: string): string | undefined;
|
|
|
19
19
|
*/
|
|
20
20
|
export function dialects(): string;
|
|
21
21
|
|
|
22
|
+
/**
|
|
23
|
+
* Where the assembled program sits in memory, as JSON.
|
|
24
|
+
*
|
|
25
|
+
* `{"origin": 32768, "length": 11}` — the load address and the number of
|
|
26
|
+
* bytes, which together are the range the program occupies.
|
|
27
|
+
*
|
|
28
|
+
* A page running a reader's code needs this to tell whether the machine is
|
|
29
|
+
* still executing that code. A program that runs past its own last
|
|
30
|
+
* instruction has a program counter outside this range, which is the
|
|
31
|
+
* difference between "the machine stopped" and "your program ran off the end
|
|
32
|
+
* — that is what the `halt` at the bottom prevents".
|
|
33
|
+
*
|
|
34
|
+
* `origin` is `null` for a linked image whose bytes are the linker's, with no
|
|
35
|
+
* single meaningful load address. `null` overall when the dialect is unknown
|
|
36
|
+
* or the source does not assemble — [`assemble`] says why.
|
|
37
|
+
*/
|
|
38
|
+
export function extent(dialect: string, source: string): string | undefined;
|
|
39
|
+
|
|
22
40
|
/**
|
|
23
41
|
* The `--listing` rendering of `source` in `dialect`: address, bytes, and
|
|
24
42
|
* source per line. `null` when the dialect is unknown or the source does not
|
|
@@ -65,6 +83,7 @@ export interface InitOutput {
|
|
|
65
83
|
readonly memory: WebAssembly.Memory;
|
|
66
84
|
readonly assemble: (a: number, b: number, c: number, d: number) => [number, number];
|
|
67
85
|
readonly dialects: () => [number, number];
|
|
86
|
+
readonly extent: (a: number, b: number, c: number, d: number) => [number, number];
|
|
68
87
|
readonly listing: (a: number, b: number, c: number, d: number) => [number, number];
|
|
69
88
|
readonly snapshot: (a: number, b: number, c: number, d: number) => [number, number];
|
|
70
89
|
readonly tape: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => [number, number];
|
package/asm198x_web.js
CHANGED
|
@@ -45,6 +45,39 @@ export function dialects() {
|
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
+
/**
|
|
49
|
+
* Where the assembled program sits in memory, as JSON.
|
|
50
|
+
*
|
|
51
|
+
* `{"origin": 32768, "length": 11}` — the load address and the number of
|
|
52
|
+
* bytes, which together are the range the program occupies.
|
|
53
|
+
*
|
|
54
|
+
* A page running a reader's code needs this to tell whether the machine is
|
|
55
|
+
* still executing that code. A program that runs past its own last
|
|
56
|
+
* instruction has a program counter outside this range, which is the
|
|
57
|
+
* difference between "the machine stopped" and "your program ran off the end
|
|
58
|
+
* — that is what the `halt` at the bottom prevents".
|
|
59
|
+
*
|
|
60
|
+
* `origin` is `null` for a linked image whose bytes are the linker's, with no
|
|
61
|
+
* single meaningful load address. `null` overall when the dialect is unknown
|
|
62
|
+
* or the source does not assemble — [`assemble`] says why.
|
|
63
|
+
* @param {string} dialect
|
|
64
|
+
* @param {string} source
|
|
65
|
+
* @returns {string | undefined}
|
|
66
|
+
*/
|
|
67
|
+
export function extent(dialect, source) {
|
|
68
|
+
const ptr0 = passStringToWasm0(dialect, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
69
|
+
const len0 = WASM_VECTOR_LEN;
|
|
70
|
+
const ptr1 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
71
|
+
const len1 = WASM_VECTOR_LEN;
|
|
72
|
+
const ret = wasm.extent(ptr0, len0, ptr1, len1);
|
|
73
|
+
let v3;
|
|
74
|
+
if (ret[0] !== 0) {
|
|
75
|
+
v3 = getStringFromWasm0(ret[0], ret[1]);
|
|
76
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
77
|
+
}
|
|
78
|
+
return v3;
|
|
79
|
+
}
|
|
80
|
+
|
|
48
81
|
/**
|
|
49
82
|
* The `--listing` rendering of `source` in `dialect`: address, bytes, and
|
|
50
83
|
* source per line. `null` when the dialect is unknown or the source does not
|
package/asm198x_web_bg.wasm
CHANGED
|
Binary file
|