https://github.com/akkartik/mu/blob/main/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 draw-cursor-on-real-screen g: grapheme
7 sig color-rgb color: int -> _/ecx: int, _/edx: int, _/ebx: int
8
9
10 sig read-key kbd: (addr keyboard) -> _/eax: byte
11
12
13 sig load-sectors disk: (addr disk), lba: int, n: int, out: (addr stream byte)
14 sig store-sectors disk: (addr disk), lba: int, n: int, out: (addr stream byte)
15
16
17 sig read-mouse-event -> _/eax: int, _/ecx: int
18
19
20 sig count-test-failure
21 sig num-test-failures -> _/eax: int
22
23 sig string-equal? s: (addr array byte), benchmark: (addr array byte) -> _/eax: boolean
24 sig string-starts-with? s: (addr array byte), benchmark: (addr array byte) -> _/eax: boolean
25 sig check-strings-equal s: (addr array byte), expected: (addr array byte), msg: (addr array byte)
26
27
28 sig check-stack
29 sig show-stack-state
30 sig debug-print x: (addr array byte), fg: int, bg: int
31 sig debug-print? -> _/eax: boolean
32 sig turn-on-debug-print
33 sig turn-off-debug-print
34 sig abort e: (addr array byte)
35 sig dump-call-stack
36
37
38 sig clear-stream f: (addr stream _)
39 sig rewind-stream f: (addr stream _)
40 sig stream-data-equal? f: (addr stream byte), s: (addr array byte) -> _/eax: boolean
41 sig streams-data-equal? f: (addr stream byte), s: (addr stream byte) -> _/eax: boolean
42 sig check-stream-equal f: (addr stream byte), s: (addr array byte), msg: (addr array byte)
43 sig next-stream-line-equal? f: (addr stream byte), s: (addr array byte) -> _/eax: boolean
44 sig check-next-stream-line-equal f: (addr stream byte), s: (addr array byte), msg: (addr array byte)
45 sig write f: (addr stream byte), s: (addr array byte)
46 sig write-stream f: (addr stream byte), s: (addr stream byte)
47 sig read-byte s: (addr stream byte) -> _/eax: byte
48 sig append-byte f: (addr stream byte), n: int
49
50 sig append-byte-hex f: (addr stream byte), n: int
51 sig write-int32-hex f: (addr stream byte), n: int
52 sig write-int32-hex-bits f: (addr stream byte), n: int, bits: int
53 sig hex-int? in: (addr slice) -> _/eax: boolean
54 sig parse-hex-int in: (addr array byte) -> _/eax: int
55 sig parse-hex-int-from-slice in: (addr slice) -> _/eax: int
56
57 sig hex-digit? c: byte -> _/eax: boolean
58
59 sig parse-decimal-int in: (addr array byte) -> _/eax: int
60 sig parse-decimal-int-from-slice in: (addr slice) -> _/eax: int
61 sig parse-decimal-int-from-stream in: (addr stream byte) -> _/eax: int
62
63 sig decimal-size n: int -> _/eax: int
64
65
66 sig lookup h: (handle _T) -> _/eax: (addr _T)
67 sig handle-equal? a: (handle _T), b: (handle _T) -> _/eax: boolean
68 sig copy-handle src: (handle _T), dest: (addr handle _T)
69
70
71 sig copy-array ad: (addr allocation-descriptor), src: (addr array _T), out: (addr handle array _T)
72
73 sig slice-empty? s: (addr slice) -> _/eax: boolean
74 sig slice-equal? s: (addr slice), p: (addr array byte) -> _/eax: boolean
75 sig slice-starts-with? s: (addr slice), head: (addr array byte) -> _/eax: boolean
76 sig write-slice out: (addr stream byte), s: (addr slice)
77
78 sig slice-to-string ad: (addr allocation-descriptor), in: (addr slice), out: (addr handle array byte)
79 sig write-int32-decimal out: (addr stream byte), n: int
80 sig decimal-digit? c: grapheme -> _/eax: boolean
81 sig to-decimal-digit in: grapheme -> _/eax: int
82
83
84
85 sig next-word line: (addr stream byte), out: (addr slice)
86 sig next-raw-word line: (addr stream byte), out: (addr slice)
87 sig stream-empty? s: (addr stream _) -> _/eax: boolean
88 sig stream-full? s: (addr stream _) -> _/eax: boolean
89 sig stream-to-array in: (addr stream _), out: (addr handle array _)
90 sig unquote-stream-to-array in: (addr stream _), out: (addr handle array _)
91 sig stream-first s: (addr stream byte) -> _/eax: byte
92 sig stream-final s: (addr stream byte) -> _/eax: byte
93
94
95 sig copy-array-object src: (addr array _), dest-ah: (addr handle array _)
96 sig array-equal? a: (addr array int), b: (addr array int) -> _/eax: boolean
97 sig parse-array-of-ints s: (addr array byte), out: (addr handle array int)
98 sig parse-array-of-decimal-ints s: (addr array byte), out: (addr handle array int)
99 sig check-array-equal a: (addr array int), expected: (addr string), msg: (addr string)
100
101 sig integer-divide a: int, b: int -> _/eax: int, _/edx: int