https://github.com/akkartik/mu/blob/main/apps/ex2.mu
 1 # Test out the video mode by filling in the screen with pixels.
 2 #
 3 # To build a disk image:
 4 #   ./translate apps/ex2.mu        # emits code.img
 5 # To run:
 6 #   qemu-system-i386 code.img
 7 
 8 fn main screen: (addr screen), keyboard: (addr keyboard), data-disk: (addr disk) {
 9   var y/eax: int <- copy 0
10   {
11     compare y, 0x300/screen-height=768
12     break-if->=
13     var x/edx: int <- copy 0
14     {
15       compare x, 0x400/screen-width=1024
16       break-if->=
17       var color/ecx: int <- copy x
18       color <- and 0xff
19       pixel screen x, y, color
20       x <- increment
21       loop
22     }
23     y <- increment
24     loop
25   }
26 }