https://github.com/akkartik/mu/blob/main/baremetal/400.mu
1
2 sig pixel-on-real-screen x: int, y: int, color: int
3 sig draw-grapheme-on-real-screen g: grapheme, x: int, y: int, color: int, background-color: int
4 sig cursor-position-on-real-screen -> _/eax: int, _/ecx: int
5 sig set-cursor-position-on-real-screen x: int, y: int
6 sig show-cursor-on-real-screen g: grapheme
7
8
9 sig read-key kbd: (addr keyboard) -> _/eax: byte
10
11
12 sig count-test-failure
13 sig num-test-failures -> _/eax: int
14
15 sig check-strings-equal s: (addr array byte), expected: (addr array byte), msg: (addr array byte)
16
17
18 sig clear-stream f: (addr stream _)
19 sig rewind-stream f: (addr stream _)
20 sig stream-data-equal? f: (addr stream byte), s: (addr array byte) -> _/eax: boolean
21 sig check-stream-equal f: (addr stream byte), s: (addr array byte), msg: (addr array byte)
22 sig next-stream-line-equal? f: (addr stream byte), s: (addr array byte) -> _/eax: boolean
23 sig check-next-stream-line-equal f: (addr stream byte), s: (addr array byte), msg: (addr array byte)
24 sig write f: (addr stream byte), s: (addr array byte)
25 sig read-byte s: (addr stream byte) -> _/eax: byte
26 sig append-byte f: (addr stream byte), n: int
27
28 sig append-byte-hex f: (addr stream byte), n: int
29 sig write-int32-hex f: (addr stream byte), n: int
30 sig write-int32-hex-bits f: (addr stream byte), n: int, bits: int
31 sig is-hex-int? in: (addr slice) -> _/eax: boolean
32 sig parse-hex-int in: (addr array byte) -> _/eax: int
33 sig parse-hex-int-from-slice in: (addr slice) -> _/eax: int
34
35 sig is-hex-digit? c: byte -> _/eax: boolean
36
37 sig parse-decimal-int in: (addr array byte) -> _/eax: int
38 sig parse-decimal-int-from-slice in: (addr slice) -> _/eax: int
39 sig parse-decimal-int-from-stream in: (addr stream byte) -> _/eax: int
40
41 sig decimal-size n: int -> _/eax: int
42
43
44 sig lookup h: (handle _T) -> _/eax: (addr _T)
45 sig handle-equal? a: (handle _T), b: (handle _T) -> _/eax: boolean
46 sig copy-handle src: (handle _T), dest: (addr handle _T)
47
48
49 sig copy-array ad: (addr allocation-descriptor), src: (addr array _T), out: (addr handle array _T)
50
51 sig slice-empty? s: (addr slice) -> _/eax: boolean
52 sig slice-equal? s: (addr slice), p: (addr array byte) -> _/eax: boolean
53 sig slice-starts-with? s: (addr slice), head: (addr array byte) -> _/eax: boolean
54 sig write-slice out: (addr stream byte), s: (addr slice)
55
56 sig slice-to-string ad: (addr allocation-descriptor), in: (addr slice), out: (addr handle array byte)
57 sig write-int32-decimal out: (addr stream byte), n: int
58 sig is-decimal-digit? c: grapheme -> _/eax: boolean
59 sig to-decimal-digit in: grapheme -> _/eax: int
60
61
62
63 sig next-word line: (addr stream byte), out: (addr slice)
64 sig next-raw-word line: (addr stream byte), out: (addr slice)
65 sig stream-empty? s: (addr stream _) -> _/eax: boolean
66 sig stream-full? s: (addr stream _) -> _/eax: boolean
67 sig stream-to-array in: (addr stream _), out: (addr handle array _)
68 sig unquote-stream-to-array in: (addr stream _), out: (addr handle array _)
69 sig stream-first s: (addr stream byte) -> _/eax: byte
70 sig stream-final s: (addr stream byte) -> _/eax: byte
71
72
73 sig copy-array-object src: (addr array _), dest-ah: (addr handle array _)
74 sig array-equal? a: (addr array int), b: (addr array int) -> _/eax: boolean
75 sig parse-array-of-ints s: (addr array byte), out: (addr handle array int)
76 sig parse-array-of-decimal-ints s: (addr array byte), out: (addr handle array int)
77 sig check-array-equal a: (addr array int), expected: (addr string), msg: (addr string)
78
79 sig integer-divide a: int, b: int -> _/eax: int, _/edx: int