JASM is an educational Virtual Machine (VM) and development environment built entirely in vanilla JavaScript. It is designed to teach low-level systems programming, computer architecture, and compiler design.
- Custom ISA: A simple 16-byte instruction set architecture (JASM Bytecode) designed for readability and ease of learning.
- Hardware Peripherals: Memory-mapped I/O devices including a PPU (Graphics), Keyboard, and Serial Adapter.
- Interrupt Vector Table (IVT): Full support for hardware interrupts and interrupt handlers (
IRET). - Integrated Toolchain: Includes a web-based IDE, a built-in Assembler, and a high-level
Mini-LangCompiler. - Web-Based: Runs entirely in the browser, making it universally accessible without any installation.
The JASM VM operates on a 32-bit memory model with specialized hardware addresses for I/O operations:
- 0x0000 - 0x03FF: IVT (Interrupt Vector Table)
- 0x1000 - 0x1FFF: Text Segment (Executable Code)
- 0x2000 - 0x2FFF: Data Segment (Variables/Memory)
- 0x3000 - 0x3FFF: Stack Space
- PPU (Picture Processing Unit):
0x10200(66048) - Supports custom palettes, tile-based rendering, and basic sprites. - Serial Adapter:
0x10300(66304) - Used for transmitting and receiving raw byte streams, suitable for cross-VM communication or BootROM OS prototyping.
- Clone this repository.
- Serve the directory using any static web server (e.g.,
python -m http.server). - Open
index.htmlin your browser. - Select one of the examples from the dropdown (e.g.,
gpu_demo,serial_echo, ormini-hello). - Click Assemble to convert the code to JASM bytecode.
- Click Load to flash it to the VM's memory.
- Click Run to execute!
JASM includes a custom high-level programming language that compiles directly down to JASM bytecode. It supports standard control flow structures (if/while), string literals, and direct memory access (peek/poke) for writing low-level drivers entirely in high-level code.
MIT