{"_id":"@asm198x/z80","_rev":"4-eee6ba0239e785fa9731b8f7322e07d7","name":"@asm198x/z80","dist-tags":{"latest":"0.4.0"},"versions":{"0.1.0":{"name":"@asm198x/z80","version":"0.1.0","license":"GPL-2.0-or-later","_id":"@asm198x/z80@0.1.0","maintainers":[{"name":"stevehill","email":"steve@stevehill.xyz"}],"homepage":"https://github.com/asm198x/asm198x#readme","bugs":{"url":"https://github.com/asm198x/asm198x/issues"},"dist":{"shasum":"6eae92ba48fb770161480798f3256ac38352503e","tarball":"https://registry.npmjs.org/@asm198x/z80/-/z80-0.1.0.tgz","fileCount":6,"integrity":"sha512-LBd32GDpLDLTSsOH5lfFKOFLMJdZsehf0/OlFAKv4a7zHzzTwdGiweM+rM4OCpv6ttIR1w8F92TRuzq0kzEsHQ==","signatures":[{"sig":"MEYCIQDanWQbCbocSN4o0yD3xYhVETGpcRon0sb/ge3GTpmC8wIhANkUB97rcXkpQle+ciA9L2HkBBbYEqXFGGzAds8yHBOk","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":466172},"main":"asm198x_web.js","type":"module","types":"asm198x_web.d.ts","gitHead":"5438d70e67c6665d44c3516dc9538466db8d32b3","_npmUser":{"name":"stevehill","email":"steve@stevehill.xyz"},"repository":{"url":"git+https://github.com/asm198x/asm198x.git","type":"git"},"_npmVersion":"11.14.1","description":"asm198x assembler for z80, compiled to WebAssembly.","directories":{},"sideEffects":["./snippets/*"],"_nodeVersion":"24.9.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/z80_0.1.0_1788418869766_0.11209744099889662","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@asm198x/z80","version":"0.2.0","license":"GPL-2.0-or-later","_id":"@asm198x/z80@0.2.0","maintainers":[{"name":"stevehill","email":"steve@stevehill.xyz"}],"homepage":"https://github.com/asm198x/asm198x#readme","bugs":{"url":"https://github.com/asm198x/asm198x/issues"},"dist":{"shasum":"f198bb3c84d7c4e4648e09103dde2b7be344b789","tarball":"https://registry.npmjs.org/@asm198x/z80/-/z80-0.2.0.tgz","fileCount":6,"integrity":"sha512-x1vShdFPOTouPhb53WQOErW+KCJIkJ6nXf/Iw30rCCLAGFJ/K+VUVqekcw8xtdarQbf4r3fkMwbrjskkJk+QnQ==","signatures":[{"sig":"MEUCIA1/zt7baJeAwDRxoHbSUb0zKRjie9iTo5yzIiJWWrQ/AiEA1wKx2Kl2yPJUZJSyCT4wdv2Bp7CVul7zrYdK6PCu1zE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@asm198x%2fz80@0.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":466857},"main":"asm198x_web.js","type":"module","types":"asm198x_web.d.ts","gitHead":"876ec9599801db1c17c229f4711620db085c845d","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:2b42eb51-bdfc-415c-b5d9-ae9fcbe69e7e"}},"repository":{"url":"git+https://github.com/asm198x/asm198x.git","type":"git"},"_npmVersion":"11.19.1","description":"asm198x assembler for z80, compiled to WebAssembly.","directories":{},"sideEffects":["./snippets/*"],"_nodeVersion":"22.23.2","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/z80_0.2.0_1788420397386_0.9776924840930485","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@asm198x/z80","version":"0.3.0","license":"GPL-2.0-or-later","_id":"@asm198x/z80@0.3.0","maintainers":[{"name":"stevehill","email":"steve@stevehill.xyz"}],"homepage":"https://github.com/asm198x/asm198x#readme","bugs":{"url":"https://github.com/asm198x/asm198x/issues"},"dist":{"shasum":"72471dfc853229c2ae86fd24bcf79cf4624c46d4","tarball":"https://registry.npmjs.org/@asm198x/z80/-/z80-0.3.0.tgz","fileCount":6,"integrity":"sha512-uR1B0DeFUaMtU/87+hIxwcXoIhgSWZL16sjDnueSxORQTJzBDNLoyPPQuTZerziyBTMmP3B8IkBfItW0UOuPhA==","signatures":[{"sig":"MEQCIE1UZm+W6qkJ5pO9QSDUK7UlGwyO+B4hov6a2gj5oPBXAiAxmekH7FR/IWtwJ8NVUGEyiYT8ExucT292RVbj6VhSyA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@asm198x%2fz80@0.3.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":469829},"main":"asm198x_web.js","type":"module","types":"asm198x_web.d.ts","gitHead":"8dcba64ffc6c2ef067d2ed09b0ba9bbdff3991a5","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:2b42eb51-bdfc-415c-b5d9-ae9fcbe69e7e"}},"repository":{"url":"git+https://github.com/asm198x/asm198x.git","type":"git"},"_npmVersion":"11.19.1","description":"asm198x assembler for z80, compiled to WebAssembly.","directories":{},"sideEffects":["./snippets/*"],"_nodeVersion":"22.23.2","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/z80_0.3.0_1788424069887_0.6800905863655149","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"name":"@asm198x/z80","type":"module","description":"asm198x assembler for z80, compiled to WebAssembly.","version":"0.4.0","license":"GPL-2.0-or-later","repository":{"type":"git","url":"git+https://github.com/asm198x/asm198x.git"},"main":"asm198x_web.js","types":"asm198x_web.d.ts","sideEffects":["./snippets/*"],"gitHead":"00e7193329b0bbe6732f19646eeac06a6444ffd2","_id":"@asm198x/z80@0.4.0","bugs":{"url":"https://github.com/asm198x/asm198x/issues"},"homepage":"https://github.com/asm198x/asm198x#readme","_nodeVersion":"22.23.2","_npmVersion":"11.19.1","dist":{"integrity":"sha512-Z3coAY4YFDTLrXiy3ej7nPRJrLd13G8dQmrOZPgDS8Xiciev5ZlpQNUVw4mY2AwDQxuZZevUU5pF0lSX0m3GBA==","shasum":"310ae03f2b51c63810666c47b4da0b747abae133","tarball":"https://registry.npmjs.org/@asm198x/z80/-/z80-0.4.0.tgz","fileCount":6,"unpackedSize":540718,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@asm198x%2fz80@0.4.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIENJWAPdZz40ZLKQwbe/UO3SMdiN9IWywEwYzoKkbw1fAiAuoNceGJTDjlb8S2LLSHQPmJ9nBqcSOb4eEZWhJAdsqw=="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:2b42eb51-bdfc-415c-b5d9-ae9fcbe69e7e"}},"directories":{},"maintainers":[{"name":"stevehill","email":"steve@stevehill.xyz"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/z80_0.4.0_1788560616929_0.7148015776970122"},"_hasShrinkwrap":false}},"time":{"created":"2026-09-03T07:01:09.509Z","modified":"2026-09-04T22:23:37.564Z","0.1.0":"2026-09-03T07:01:09.936Z","0.2.0":"2026-09-03T07:26:37.551Z","0.3.0":"2026-09-03T08:27:50.046Z","0.4.0":"2026-09-04T22:23:37.136Z"},"bugs":{"url":"https://github.com/asm198x/asm198x/issues"},"license":"GPL-2.0-or-later","homepage":"https://github.com/asm198x/asm198x#readme","repository":{"type":"git","url":"git+https://github.com/asm198x/asm198x.git"},"description":"asm198x assembler for z80, compiled to WebAssembly.","maintainers":[{"name":"stevehill","email":"steve@stevehill.xyz"}],"readme":"# asm198x-web\n\nThe [asm198x](https://github.com/asm198x/asm198x) assembler compiled to\nWebAssembly, with a `wasm-bindgen` surface a web page can call. Nothing is\nuploaded anywhere: the assembler runs in the visitor's tab.\n\nPublished to npm as **`@asm198x/web`**; `scripts/build-npm.sh` builds it. The\ncrate itself stays off crates.io: a `wasm-bindgen` surface returning JavaScript\nvalues has no Rust caller.\n\n```sh\nnpm install @asm198x/web\n```\n\n## Surface\n\n```js\nimport init, { assemble, assemble_project, snapshot, listing, dialects } from '@asm198x/web';\n\nawait init();\n\nconst result = JSON.parse(assemble('sjasmplus', ' org 32768\\n ld a,1\\n ret\\n'));\nif (Array.isArray(result)) {\n  // The diagnostics array: `result[0].message`, `result[0].span.line`.\n} else {\n  // The `AssemblyResult` object: `result.bytes`, `result.origin`, `result.symbols`.\n}\n\nlisting('acme', '*=$c000\\n lda #1\\n rts\\n');  // the `--listing` text, or null\nJSON.parse(dialects());                        // [{ name, aliases, blurb }, …]\n```\n\n`assemble` returns the string `asm198x --message-format=json` prints, so the\n[CLI reference](https://asm198x.github.io/docs/cli/) documents the shape.\nIt returns `null` for a dialect name the table does not list.\n\nFor a named in-memory project, including target selection and the browser-safe\nnative output options:\n\n```js\nconst result = JSON.parse(assemble_project(JSON.stringify({\n  dialect: 'sjasmplus',\n  target: 'z80n',             // optional: z80, z80n/next\n  root: 'src/main.asm',\n  files: {\n    'src/main.asm': ' include \"part.asm\"\\n',\n    'part.asm': ' nextreg $07,$02\\n',\n  },\n  output: 'raw',              // optional; 'hunk' is available for vasm\n})));\n```\n\nThe file map is text: source includes are supported, while binary `incbin`\npayloads remain outside this surface. `hunk` is included because it is wholly\nrepresented by the returned bytes; filesystem-only CLI behaviour is not.\n\n## Build\n\n```sh\nwasm-pack build --target web crates/asm198x-web --out-dir pkg-web\nwasm-pack test --node crates/asm198x-web\n```\n\nThe crate is excluded from the workspace, so it carries its own `Cargo.lock`;\n`cargo update -p asm198x --manifest-path crates/asm198x-web/Cargo.toml`\nrefreshes the path entry after the library's version moves.\n\n## Size\n\nEvery dialect ships in one module. Measured 2026-09-04, `opt-level = \"z\"`,\nafter wasm-opt: 1,505,582 bytes raw, 514,986 gzipped. A per-platform split\n(#495) is a decision for when a consumer needs one.\n\n## Running what you assembled\n\n`snapshot(dialect, source)` returns a 48K `.sna` — the same bytes\n`asm198x --dialect pasmonext --sna` writes, verified byte for byte — so a page\ncan assemble and then run the result:\n\n```js\nconst sna = snapshot('pasmonext', source);\nif (sna) spectrum.loadSnapshot(sna, 'sna');   // @emu198x/zx-spectrum\n```\n\nSpectrum Z80 only, and the source needs `end <addr>` for its entry point,\nexactly as the command line demands. `null` means it did not assemble;\n`assemble()` says why.\n\n## Size: take one architecture\n\n`@asm198x/web` carries every dialect — 1.4 MB raw, 480 KB gzipped. Almost none\nof that is useful to a page teaching one machine, so the package is also built\nper CPU architecture:\n\n| package | raw | gzipped |\n|---|---|---|\n| `@asm198x/web` (all) | 1470 KB | 503 KB |\n| `@asm198x/z80` | 486 KB | 185 KB |\n\n`entry` is the only thing that names the library's assembler entry points, so a\nbuild that does not select an architecture never references it and the linker\ndrops it. Nothing is stripped by hand.\n\n```sh\nscripts/build-npm.sh z80        # -> @asm198x/z80\nscripts/build-npm.sh mos6502    # -> @asm198x/mos6502\nscripts/build-npm.sh            # -> @asm198x/web, everything\n```\n\n`dialects()` reports what the build you have can actually assemble, not the\nwhole table, so a picker made from it can never offer a name `assemble` then\nrefuses.\n\nEven at 185 KB this is bigger than an emulator embed, so a lesson page should\nstill load it lazily — on the first keystroke, not on page load.\n","readmeFilename":"README.md"}