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
16 sig clear-stream f: (addr stream _)
17 sig rewind-stream f: (addr stream _)
18 sig write f: (addr stream byte), s: (addr array byte)
19 sig read-byte s: (addr stream byte) -> _/eax: byte
20 sig append-byte f: (addr stream byte), n: int
21
22 sig append-byte-hex f: (addr stream byte), n: int
23 sig write-int32-hex f: (addr stream byte), n: int
24 sig write-int32-hex-bits f: (addr stream byte), n: int, bits: int
25 sig is-hex-int? in: (addr slice) -> _/eax: boolean
26 sig parse-hex-int in: (addr array byte) -> _/eax: int
27 sig parse-hex-int-from-slice in: (addr slice) -> _/eax: int
28
29 sig is-hex-digit? c: byte -> _/eax: boolean
30
31 sig parse-decimal-int in: (addr array byte) -> _/eax: int
32 sig parse-decimal-int-from-slice in: (addr slice) -> _/eax: int
33 sig parse-decimal-int-from-stream in: (addr stream byte) -> _/eax: int
34
35 sig decimal-size n: int -> _/eax: int
36
37
38 sig lookup h: (handle _T) -> _/eax: (addr _T)
39 sig handle-equal? a: (handle _T), b: (handle _T) -> _/eax: boolean
40 sig copy-handle src: (handle _T), dest: (addr handle _T)
41
42
43 sig copy-array ad: (addr allocation-descriptor), src: (addr array _T), out: (addr handle array _T)
44
45 sig slice-empty? s: (addr slice) -> _/eax: boolean
46 sig slice-equal? s: (addr slice), p: (addr array byte) -> _/eax: boolean
47 sig slice-starts-with? s: (addr slice), head: (addr array byte) -> _/eax: boolean
48 sig write-slice out: (addr stream byte), s: (addr slice)
49
50 sig slice-to-string ad: (addr allocation-descriptor), in: (addr slice), out: (addr handle array byte)
51 sig write-int32-decimal out: (addr stream byte), n: int
52 sig is-decimal-digit? c: grapheme -> _/eax: boolean
53 sig to-decimal-digit in: grapheme -> _/eax: int
54
55
56
57 sig next-word line: (addr stream byte), out: (addr slice)
58 sig next-raw-word line: (addr stream byte), out: (addr slice)
59 sig stream-empty? s: (addr stream _) -> _/eax: boolean