Show HN: the Hand-Rolled Assembly Machine

4 90s_dev 3 7/26/2025, 7:12:00 PM hram.dev ↗

Comments (3)

90s_dev · 7h ago
Shorter description:

It's like love2d but with a pico8 style screen and the code is entirely asm.

Download at https://hram.dev/hram-110.zip for version with hot code reloading.

Write event handler function in native assembly at appdata\hram\hsig.s that interacts with keyboard/mouse and 128x72 8-bit screen (red/green only).

Uses native jit, no interpreter. So if you write bad assembly it will segfault! But it's okay, just restart hram.exe (~360 kb) and try again.

90s_dev · 7h ago
Got one report on reddit that it's not creating the default file in appdata and just using the one in memory that it thinks it's writing. If you have the same issue, here's the whole sample asm file that you can write to appdata\hram\hsig.s before you open hram.exe:

    ; switch on arg
    cmp cl, 4
    je MouseDown
    cmp cl, 5
    je MouseUp

    ; if mouse not down then just skip
    mov al, byte [0x33000]
    test al, 1
    jz Skip

    ; draw green at mouse
    mov rax, 0
    mov rbx, 0
    mov al, [0x30007]
    mov bl, 128
    mul bl
    add al, [0x30006]
    mov byte ptr [rax+0x30100], 0x0f

    ; call blit()
    sub rsp, 24
    call [0x30030]
    add rsp, 24

    Skip:
    ret

    ; store mouse-down info

    MouseDown:
    mov byte ptr [0x33000], 1
    ret

    MouseUp:
    mov byte ptr [0x33000], 0
    ret
Fwiw I do not know assembly! This is the most complicated asm I've ever written! So if it's got dumb errors, please let me know and I'd be glad to fix them in the sample code!
90s_dev · 14h ago
Hi again HN. You said I should release early and release often so here I am.

HRAM is a computer simulator that runs real native assembly in the context of a 128x72 pixel screen with 8-bit colors (4 bits for red, 4 for green, no blue).

The idea is that you program it using your own assembly, in the same way they might have had to 50 years ago. It's almost like love2d but with assembly. You write an asm function that responds to events like mouse/keyboard/etc.

It takes your code, located at appdata\hram\hsig.s (it creates one for you on the first run) and runs it when it loads. I plan to add hot reloading soon, maybe later today.

And it's not an interpreter! It uses asmjit under the hood to compile your code into actual assembly and then just runs it. Which means this is literally as close to the metal as you can get writing games!

This is maybe the coolest and most exciting thing I've ever built. I'm really excited to see what you all think of it!

The manual is at https://hram.dev/indexb.html and the beta download file is at https://hram.dev/hram-100.zip so please let me know what you think!