https://github.com/akkartik/mu/blob/main/baremetal/ex7.mu
1
2
3
4
5
6
7
8
9
10
11
12
13 fn main {
14 var key/eax: byte <- read-key 0
15 {
16 compare key, 0x68
17 break-if-!=
18 var g/eax: grapheme <- copy 0x2d
19 draw-grapheme-at-cursor 0, g, 0x31
20 cursor-left 0
21 }
22 {
23 compare key, 0x6a
24 break-if-!=
25 var g/eax: grapheme <- copy 0x7c
26 draw-grapheme-at-cursor 0, g, 0x31
27 cursor-down 0
28 }
29 {
30 compare key, 0x6b
31 break-if-!=
32 var g/eax: grapheme <- copy 0x7c
33 draw-grapheme-at-cursor 0, g, 0x31
34 cursor-up 0
35 }
36 {
37 compare key, 0x6c
38 break-if-!=
39 var g/eax: grapheme <- copy 0x2d
40 draw-grapheme-at-cursor 0, g, 0x31
41 cursor-right 0
42 }
43 loop
44 }