https://github.com/akkartik/mu/blob/master/400.mu
1
2
3
4
5
6 sig run-tests
7
8
9
10
11 sig syscall_exit
12 sig syscall_read
13 sig syscall_write
14 sig syscall_open
15 sig syscall_close
16 sig syscall_creat
17 sig syscall_unlink
18 sig syscall_rename
19 sig syscall_mmap
20 sig syscall_ioctl
21 sig syscall_nanosleep
22 sig syscall_clock_gettime
23
24
25
26
27
28
29 sig check-ints-equal a: int, b: int, msg: (addr array byte)
30 sig kernel-string-equal? s: (addr kernel-string), benchmark: (addr array byte) -> result/eax: boolean
31 sig new-segment len: int, ad: (addr allocation-descriptor)
32 sig string-equal? s: (addr array byte), benchmark: (addr array byte) -> result/eax: boolean
33 sig string-starts-with? s: (addr array byte), benchmark: (addr array byte) -> result/eax: boolean
34 sig check-strings-equal s: (addr array byte), expected: (addr array byte), msg: (addr array byte)
35 sig clear-stream f: (addr stream byte)
36 sig rewind-stream f: (addr stream byte)
37 sig initialize-trace-stream n: int
38 sig trace line: (addr array byte)
39 sig check-trace-contains line: (addr string), msg: (addr string)
40 sig check-trace-scans-to line: (addr string), msg: (addr string)
41 sig trace-scan line: (addr array byte) -> result/eax: boolean
42 sig next-line-matches? t: (addr stream byte), line: (addr array byte) -> result/eax: boolean
43 sig skip-next-line t: (addr stream byte)
44 sig clear-trace-stream
45
46 sig stream-data-equal? f: (addr stream byte), s: (addr array byte) -> result/eax: boolean
47 sig check-stream-equal f: (addr stream byte), s: (addr array byte), msg: (addr array byte)
48 sig next-stream-line-equal? f: (addr stream byte), s: (addr array byte) -> result/eax: boolean
49 sig check-next-stream-line-equal
50 sig tailor-exit-descriptor ed: (addr exit-descriptor), nbytes: int
51 sig stop ed: (addr exit-descriptor), value: int
52
53 sig read-byte-buffered f: (addr buffered-file) -> byte-or-Eof/eax: int
54
55
56 sig write-byte-buffered f: (addr buffered-file), n: int
57 sig flush f: (addr buffered-file)
58 sig append-byte f: (addr stream byte), n: int
59 sig write-buffered f: (addr buffered-file), msg: (addr array byte)
60
61 sig append-byte-hex f: (addr stream byte), n: int
62 sig write-byte-hex-buffered f: (addr buffered-file), n: int
63 sig write-int32-hex f: (addr stream byte), n: int
64 sig write-int32-hex-buffered f: (addr buffered-file), n: int
65 sig is-hex-int? in: (addr slice) -> result/eax: boolean
66 sig parse-hex-int in: (addr array byte) -> result/eax: int
67 sig parse-hex-int-from-slice in: (addr slice) -> result/eax: int
68
69 sig is-hex-digit? c: byte -> result/eax: boolean
70
71 sig error-byte ed: (addr exit-descriptor), out: (addr buffered-file), msg: (addr array byte), n: byte
72
73
74 sig lookup h: (handle T) -> result/eax: (addr T)
75 sig handle-equal? a: handle, b: handle -> result/eax: boolean
76 sig copy-handle src: handle, dest: (addr handle)
77 sig allocate-region ad: (addr allocation-descriptor), n: int, out: (addr handle allocation-descriptor)
78 sig allocate-array ad: (addr allocation-descriptor), n: int, out: (addr handle)
79 sig copy-array ad: (addr allocation-descriptor), src: (addr array), out: (addr handle)
80 sig zero-out start: (addr byte), len: int
81 sig new-stream ad: (addr allocation-descriptor), length: int, elemsize: int, out: (addr handle stream _)
82 sig read-line-buffered f: (addr buffered-file), s: (addr stream byte)
83 sig read-line f: (addr stream byte), s: (addr stream byte)
84 sig slice-empty? s: (addr slice) -> result/eax: boolean
85 sig slice-equal? s: (addr slice), p: (addr array byte) -> result/eax: boolean
86 sig slice-starts-with? s: (addr slice), head: (addr array byte) -> result/eax: boolean
87 sig write-slice out: (addr stream byte), s: (addr slice)
88 sig write-slice-buffered out: (addr buffered-file), s: (addr slice)
89 sig slice-to-string ad: (addr allocation-descriptor), in: (addr slice), out: (addr handle array byte)
90 sig next-token in: (addr stream byte), delimiter: byte, out: (addr slice)
91 sig next-token-from-slice start: (addr byte), end: (addr byte), delimiter: byte, out: (addr slice)
92 sig skip-chars-matching in: (addr stream byte), delimiter: byte
93 sig skip-chars-matching-whitespace in: (addr stream byte)
94 sig skip-chars-not-matching in: (addr stream byte), delimiter: byte
95 sig skip-chars-not-matching-whitespace in: (addr stream byte)
96 sig skip-chars-matching-in-slice curr: (addr byte), end: (addr byte), delimiter: byte -> curr/eax: (addr byte)
97 sig skip-chars-matching-whitespace-in-slice curr: (addr byte), end: (addr byte) -> curr/eax: (addr byte)
98 sig skip-chars-not-matching-in-slice curr: (addr byte), end: (addr byte), delimiter: byte -> curr/eax: (addr byte)
99 sig skip-chars-not-matching-whitespace-in-slice curr: (addr byte), end: (addr byte) -> curr/eax: (addr byte)
100 sig skip-string line: (addr stream byte)
101 sig skip-string-in-slice curr: (addr byte), end: (addr byte) -> new_curr/eax: (addr byte)
102 sig skip-until-close-paren line: (addr stream byte)
103 sig skip-until-close-paren-in-slice curr: (addr byte), end: (addr byte) -> new_curr/eax: (addr byte)
104 sig write-stream-data f: (addr buffered-file), s: (addr stream byte)
105 sig write-int32-decimal out: (addr stream byte), n: int32
106 sig is-decimal-digit? c: byte -> result/eax: boolean
107 sig to-decimal-digit in: byte -> out/eax: int
108 sig next-word line: (addr stream byte), out: (addr slice)
109 sig has-metadata? word: (addr slice), s: (addr string) -> result/eax: boolean
110 sig is-valid-name? in: (addr slice) -> result/eax: boolean
111 sig is-label? word: (addr slice) -> result/eax: boolean
112 sig emit-hex out: (addr buffered-file), n: int, width: int
113 sig emit out: (addr buffered-file), word: (addr slice), width: int
114
115
116
117
118
119
120
121
122
123 sig slurp f: (addr buffered-file), s: (addr stream byte)
124 sig compute-width word: (addr array byte) -> result/eax: int
125 sig compute-width-of-slice s: (addr slice) -> result/eax: int
126 sig emit-hex-array out: (addr buffered-file), arr: (addr array byte)
127 sig next-word-or-string line: (addr stream byte), out: (addr slice)
128 sig write-int out: (addr stream byte), n: int
129 sig clear-stack s: (addr stack)
130 sig push s: (addr stack), n: int
131 sig pop s: (addr stack) -> n/eax: int
132 sig top s: (addr stack) -> n/eax: int
133 sig array-equal? a: (addr array int), b: (addr array int) -> result/eax: boolean
134 sig parse-array-of-ints ad: (addr allocation-descriptor), s: (addr string), out: (addr handle array int)
135 sig check-array-equal a: (addr array int), expected: (addr string), msg: (addr string)
136
137 sig kernel-string-to-string ad: (addr allocation-descriptor), in: (addr kernel-string), out: (addr handle array byte)
138 sig kernel-string-length in: (addr kernel-string) -> result/eax: int
139 sig enable-screen-grid-mode
140 sig enable-screen-type-mode
141 sig screen-size -> nrows/eax: int, ncols/ecx: int
142 sig clear-screen
143 sig move-cursor-on-screen row: int, column: int
144 sig print-string-to-screen s: (addr array byte)
145 sig print-byte-to-screen c: byte
146 sig print-int32-hex-to-screen n: int
147 sig reset-formatting-on-screen
148 sig start-color-on-screen fg: int, bg: int
149 sig start-bold-on-screen
150 sig start-underline-on-screen
151 sig start-reverse-video-on-screen
152 sig start-blinking-on-screen
153 sig hide-cursor-on-screen
154 sig show-cursor-on-screen
155 sig enable-keyboard-immediate-mode
156 sig enable-keyboard-type-mode
157 sig read-key -> result/eax: byte
158 sig open filename: (addr array byte), write?: boolean, out: (addr handle buffered-file)
159 sig size in: (addr array _) -> result/eax: int