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