How asm80/asm80-node works
Project type and purpose
• ASM80.js is a Node.js-based command-line assembler and library for assembling source code targeting various 8-bit CPUs (Z80, 8080, 6502, etc.) into multiple output formats (HEX, SREC, CP/M COM, ZX SNA/TAP, C64 PRG, raw BIN).
• It exposes both a CLI tool (asm80) and a programmatic API (asm.js, parser.js, etc.), plus ancillary tools (hextools.js, lfsnode.js) and static documentation under docs/.
File structure
• Root configuration and metadata:
• .editorconfig, .eslintrc.js/.json, .gitignore, package.json/lock
• Core modules:
• asm.js — top-level library entrypoint
• parser.js — lexical analysis & parsing into an AST
• core.json — CPU instruction set definitions & encoding tables
• monolith.js — single-file bundle builder (for browser/IDE usage)
• CLI entrypoint: lfsnode.js likely wraps the CLI or supports live-file system uses
• Utility modules: hextools.js for post-processing HEX files
• Test suite: test/ contains dozens of assembly sources and their expected binary/listing outputs
• Documentation: docs/ contains static HTML, CSS, JS, fonts and params.json for the GitBook-style docs
README for additional insights
• The CLI interface is driven by commander-style flags (-o, -t, -m, etc.)
• CPU type auto-detection by file extension but can be overridden
• Output types vary by target machine conventions
• Core logic and directive support are documented in an external GitBook