0XVM // SHOWCASE VMIM V2 · 64K RAM · DEVICE PAGE

A tiny computer
that fits in a browser.

0xvm is a stack computer small enough to read in an afternoon: 64 KiB of RAM, 64-bit cells, byte-encoded opcodes, and 256 host device ports. Write assembly or Lua-subset source, assemble it into a VMIM ROM, and run the same bytes in the CLI, SDL3, or here in the browser. The host below is live — load a ROM, type into the console, and watch the framebuffer move.

0xvm boot ROM screen

boot.rom · 320×240 · screen path

01 // LIVE HOST
02 // CODE & COMMANDS
counter.asm zero-page accumulator
INCLUDE "console.asm"

        PUSH 0          ; initial accumulator value
        PUSH 0          ; zero-page byte address
        STORE32         ; mem[0..3] = 0

        PUSH 0          ; loop counter i
loop:
        DUP
        PUSH 6
        CMP_LT
        JMP_Z done      ; exit loop when i >= 6

        DUP
        PRINT           ; print i
        PUSH 0
        LOAD32
        DUP
        PUSH 10
        ADD
        PUSH 0
        STORE32         ; mem[0..3] += 10
        POP
        PUSH 1
        ADD
        JMP loop

done:
        PUSH 0
        LOAD32
        PRINT           ; print 60
        HALT
features.asm data section + console
INCLUDE "all.asm"

EQU MSG_LEN  6
EQU VALUE    10

data:
STR "total="         ; data+0..data+5
DB 0                 ; data+6: NUL terminator
ALIGN 8              ; pad byte at data+7
value: DQ VALUE      ; data+8..data+15: 64-bit 10

PUSH data
PUSH MSG_LEN
PRINT_STR
PUSH 10
PRINT_CHAR

PUSH value
LOAD64
PRINT
HALT
devices.lua Lua subset intrinsics
const ENABLE = 1

if ENABLE == 1 then
    local w, h = screen_size()
    print(w)
    print(h)

    set_color(0xFFC040)
    plot(1, 2)
    draw()
    clear()

    print(read_key())
    print(quit_requested())
    print(now_ms() >= 0)
    sleep(1)
    print("DEVICE OK")
end
terminal build → inspect → run
make all

./build/0xasm -f examples/counter.asm -o build/counter.rom
./build/0xrom -f build/counter.rom
./build/0xdis -f build/counter.rom
./build/0xvm -f build/counter.rom
./build/0xvm              # built-in boot ROM, no -f needed
./build/0xdb -f examples/gcd.asm

python3 -m luac compile examples/typography.lua \
  -o build/lua-typography.asm -m build/lua-typography.lumap
./build/0xasm -f build/lua-typography.asm -o build/lua-typography.rom
./build/0xvm-sdl -f build/lua-typography.rom

make wasm
python3 -m http.server 8000 --directory build
03 // PIPELINE
01 // source

Assembly or Lua-subset source describes the program and its data.

examples/counter.asm
02 // encode

0xluac emits 0xasm; 0xasm writes byte opcodes and a VMIM header.

0xasm -f source.asm
03 // rom

A VMIM v2 image carries the payload mapped at 0x0100.

build/counter.rom
04 // host

CLI, SDL3, or WASM copies the payload into RAM and starts at the entry.

0xvm -f build/counter.rom
05 // devices

DEI and DEO cross the thin host boundary to console, screen, controller, and timer.

DEO CONSOLE_PUTC
04 // THE MACHINE
64 KiBbyte-addressed RAM
64-bitstack cells, outside RAM
16-bitaddresses, 0x0000–0xFFFF
256device ports, outside RAM
0x0100ROM image entry point
v2VMIM ROM format