https://github.com/akkartik/mu/blob/main/ex2.mu
1
2
3
4
5
6
7
8
9
10 fn main screen: (addr screen), keyboard: (addr keyboard), data-disk: (addr disk) {
11 var y/eax: int <- copy 0
12 {
13 compare y, 0x300/screen-height=768
14 break-if->=
15 var x/edx: int <- copy 0
16 {
17 compare x, 0x400/screen-width=1024
18 break-if->=
19 var color/ecx: int <- copy x
20 color <- and 0xff
21 pixel-on-real-screen x, y, color
22 x <- increment
23 loop
24 }
25 y <- increment
26 loop
27 }
28 foo
29 }
30
31 fn foo {
32 bar
33 }
34
35 fn bar {
36 abort "aaa"
37 }