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 {
15 var key/eax: byte <- read-key 0
16 {
17 compare key, 0x68
18 break-if-!=
19 var g/eax: grapheme <- copy 0x2d
20 draw-grapheme-at-cursor 0, g, 0x31
21 cursor-left 0
22 }
23 {
24 compare key, 0x6a
25 break-if-!=
26 var g/eax: grapheme <- copy 0x7c
27 draw-grapheme-at-cursor 0, g, 0x31
28 cursor-down 0
29 }
30 {
31 compare key, 0x6b
32 break-if-!=
33 var g/eax: grapheme <- copy 0x7c
34 draw-grapheme-at-cursor 0, g, 0x31
35 cursor-up 0
36 }
37 {
38 compare key, 0x6c
39 break-if-!=
40 var g/eax: grapheme <- copy 0x2d
41 draw-grapheme-at-cursor 0, g, 0x31
42 cursor-right 0
43 }
44 loop
45 }
46 }