How mykbamberg/assembler-website works
This is a browser-based assembler for the cpu-simulator. The user edits assembly in Ace; changes invoke the WebAssembly-exported assembler, which parses instructions, resolves labels, emits a 16-byte program and diagnostic text, then exposes simulator and sharing actions. Examples, syntax highlighting, Vim mode, theme selection, and diagnostic visibility are supporting editor capabilities. The browser integration with Ace and the simulator is shown; build details and unsampled HTML are omitted.
Main entry points: index.js WebAssembly module interface · as.c Assembly parser and encoder · asm-mode.js Assembly syntax mode
Components 14
Assembly editor
- Ace editor UI
src/index.js - Assembly syntax mode
src/asm-mode.js - Example programs
src/index.js - Vim and theme controls
src/index.js
Assembly compilation
- Assembly parser and encoder
src/as.c - Label resolution
src/as.c - Diagnostic formatter
src/as.c - WebAssembly module interface
src/index.js
Output and sharing
- Machine-code output
src/index.js - CPU simulator
- Code sharing
src/index.js - Diagnostic visibility controls
src/index.js
Other components
- Program author
- Browser clipboard
Connections 15
- Program author → Ace editor UI: edits source
src/index.js - Ace editor UI → Assembly syntax mode: sets syntax mode
src/index.js - Example programs → Ace editor UI: loads source
src/index.js - Program author → Vim and theme controls: chooses editor settings
src/index.js - Ace editor UI → WebAssembly module interface: assembles on change
src/index.js - WebAssembly module interface → Assembly parser and encoder: calls assemble
src/index.js - Assembly parser and encoder → Label resolution: resolves references
src/as.c - Assembly parser and encoder → Diagnostic formatter: formats messages
src/as.c - WebAssembly module interface → Machine-code output: returns program
src/index.js - WebAssembly module interface → Diagnostic formatter: reads error buffer
src/index.js - Machine-code output → CPU simulator: opens program
src/index.js - Program author → Code sharing: requests share link
src/index.js - Code sharing → Browser clipboard: writes link
src/index.js - Program author → Diagnostic visibility controls: toggles messages
src/index.js - Diagnostic visibility controls → Diagnostic formatter: controls visibility
src/index.js