tangled
alpha
login
or
join now
tjh.dev
/
um32
1
fork
atom
Implementation of the UM-32 "Universal Machine" as described by the
Cult of the Bound Variable
1
fork
atom
overview
issues
pulls
pipelines
docs: update README and author
Signed-off-by: tjh <x@tjh.dev>
tjh.dev
1 month ago
3434c69f
b1339d4b
verified
This commit was signed with the committer's
known signature
.
tjh.dev
SSH Key Fingerprint:
SHA256:RhG+o7Aj/xulPOqGBYDE7G2RZdwS1M7RWqL3oo9BYCY=
2/2
clippy.yaml
success
43s
unit-tests.yaml
success
43s
+38
-1
2 changed files
expand all
collapse all
unified
split
Cargo.toml
README.md
+1
-1
Cargo.toml
···
2
2
name = "um"
3
3
version = "0.2.1"
4
4
edition = "2021"
5
5
-
authors = ["tjh <14987462+thomhayward@users.noreply.github.com>"]
5
5
+
authors = ["tjh <x@tjh.dev>"]
6
6
license = "GPL-3.0-only"
7
7
default-run = "um"
8
8
rust-version = "1.74.1"
+37
README.md
···
8
8
```sh
9
9
; cargo run --release -- files/sandmark.umz
10
10
```
11
11
+
12
12
+
`um` also features a rudimentary assembler, with an assembly language loosely modelled
13
13
+
on ARM assembly.
14
14
+
15
15
+
files/hello-world.asm:
16
16
+
```asm
17
17
+
;
18
18
+
; hello-world.asm
19
19
+
;
20
20
+
; Prints "Hello, world!" to the stdout.
21
21
+
;
22
22
+
message:
23
23
+
.wstr "Hello, world!\n"
24
24
+
25
25
+
adr r1, message
26
26
+
adr r4, loop
27
27
+
mov r3, 1
28
28
+
loop:
29
29
+
ldr r2, [r0, r1]
30
30
+
adr r6, next
31
31
+
adr r7, end
32
32
+
mov r7, r6, r2
33
33
+
jmp [r0, r7]
34
34
+
next:
35
35
+
out r2
36
36
+
add r1, r3
37
37
+
jmp [r0, r4]
38
38
+
39
39
+
end:
40
40
+
halt
41
41
+
```
42
42
+
43
43
+
To assemble and run, enable the `asm` feature with cargo:
44
44
+
45
45
+
```sh
46
46
+
; cargo run --features asm -- files/hello-world.asm
47
47
+
```