https://github.com/akkartik/mu/blob/main/ex10.mu
1
2
3
4
5
6
7
8
9
10
11
12
13
14 fn main {
15
16 $main:event-loop: {
17 var dx/eax: int <- copy 0
18 var dy/ecx: int <- copy 0
19 dx, dy <- read-mouse-event
20 {
21 compare dx, 0
22 break-if-!=
23 compare dy, 0
24 break-if-!=
25 loop $main:event-loop
26 }
27 {
28 var dummy1/eax: int <- copy 0
29 var dummy2/ecx: int <- copy 0
30 dummy1, dummy2 <- draw-text-wrapping-right-then-down-over-full-screen 0/screen, " ", 0/x, 0x10/y, 0x31/fg, 0/bg
31 }
32 {
33 var dummy/ecx: int <- copy 0
34 dx, dummy <- draw-int32-decimal-wrapping-right-then-down-over-full-screen 0/screen, dx, 0/x, 0x10/y, 0x31/fg, 0/bg
35 }
36 {
37 var dummy/eax: int <- copy 0
38 dummy, dy <- draw-int32-decimal-wrapping-right-then-down-over-full-screen 0/screen, dy, 5/x, 0x10/y, 0x31/fg, 0/bg
39 }
40 loop
41 }
42 }