The dasm macro assembler (for JavaScript)
This is an emscripten-compiled version of the dasm macro assembler. It was created so 6502 assembly code could be compiled from JavaScript code. More especifically, it can be used to create Atari VCS 2600 and Fairchild Channel F roms from its macro assembly source code.
Technical information
This package uses version 2.20.11 of dasm.
It was built on Linux (err, Windows 10 bash) from the dasm source using the following commands:
emmake make
mv src/dasm src/dasm.bc
emcc src/dasm.bc -o dasm.js
The following changes were manually applied to the exported file:
- Wrapped the code with a function that could export it as a module
- Exported the created module as the result of a function call
- Exposed its internal file system through a
FS
variable
Usage
import * as dasm from "dasm";
const src = "...";
const result = dasm(src, "-f1", "-ofile.out", "-lfile.lst", ...);
const ROM = result.FS.readFile("file.out");
More information
Please download dasm to check its command line documentation.
Check the emscripten FileSystem to learn about FS
.
Todo
- More examples, including on how to include files
- Expose the module initialization options
- TypeScript definitions
Constributions are welcome.
License
This follows dasm itself and uses the GNU Public License v 2.0.