Implementation of the UM-32 "Universal Machine" as described by the Cult of the Bound Variable
Rust 98.6%
Assembly 1.2%
Shell 0.2%
39 1 0

Clone this repository

https://tangled.org/tjh.dev/um32 https://tangled.org/did:plc:65gha4t3avpfpzmvpbwovss7/um32
git@knot.tjh.dev:tjh.dev/um32 git@knot.tjh.dev:did:plc:65gha4t3avpfpzmvpbwovss7/um32

For self-hosted knots, clone URLs may differ based on your setup.

Download tar.gz
README.md

UM-32 "Universal Machine"#

An implementation of the UM-32 "Universal Machine" as described by the Cult of the Bound Variable.

Usage#

Run the benchmark:

; cargo run --release -- files/sandmark.umz

um also features a rudimentary assembler, with an assembly language loosely modelled on ARM assembly.

files/hello-world.asm:

;
; hello-world.asm
;
; Prints "Hello, world!" to the stdout.
;
message:
    .wstr "Hello, world!\n"

    adr r1, message
    adr r4, loop
    mov r3, 1
loop:
    ldr r2, [r0, r1]
    adr r6, next
    adr r7, end
    mov r7, r6, r2
    jmp [r0, r7]
next:
    out r2
    add r1, r3
    jmp [r0, r4]

end:
    halt

To assemble and run, enable the asm feature with cargo:

; cargo run --features asm -- files/hello-world.asm