From 00c4d6122182c37a8b37d27fd1e8e896cbdbe928 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Tue, 29 Dec 2020 21:20:36 -0800 Subject: 7472 --- html/baremetal/ex2.mu.html | 93 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 html/baremetal/ex2.mu.html (limited to 'html/baremetal/ex2.mu.html') diff --git a/html/baremetal/ex2.mu.html b/html/baremetal/ex2.mu.html new file mode 100644 index 00000000..1d2c4249 --- /dev/null +++ b/html/baremetal/ex2.mu.html @@ -0,0 +1,93 @@ + + + + +Mu - baremetal/ex2.mu + + + + + + + + + + +https://github.com/akkartik/mu/blob/master/baremetal/ex2.mu +
+ 1 # Test out the video mode by filling in the screen with pixels.
+ 2 #
+ 3 # To build a disk image:
+ 4 #   ./translate_subx_baremetal baremetal/ex2.subx    # emits disk.img
+ 5 # To run:
+ 6 #   qemu-system-i386 disk.img
+ 7 # Or:
+ 8 #   bochs -f baremetal/boot.bochsrc  # boot.bochsrc loads disk.img
+ 9 #
+10 # Expected output:
+11 #   html/baremetal.png
+12 
+13 fn main {
+14   var y/eax: int <- copy 0
+15   {
+16     compare y, 0x300  # 768
+17     break-if->=
+18     var x/edx: int <- copy 0
+19     {
+20       compare x, 0x400  # 1024
+21       break-if->=
+22       var color/ecx: int <- copy x
+23       color <- and 0xff
+24       pixel 0, x, y, color
+25       x <- increment
+26       loop
+27     }
+28     y <- increment
+29     loop
+30   }
+31 }
+
+ + + -- cgit 1.4.1-2-gfad0 :33:44 -0700 committer Kartik K. Agaram <vc@akkartik.com> 2022-06-06 18:33:44 -0700 flesh out Readme' href='/akkartik/view.love/commit/README.md?id=f0e967d2a1d9d7ceee5812accb5501b73c17ec39'>f0e967d ^
7b78c35 ^


f0e967d ^

7b78c35 ^


12f5fa9 ^









f0e967d ^






482d077 ^
f0e967d ^





1e33eee ^

7be2718 ^
1e33eee ^
53def09 ^
96df187 ^
f8cdd01 ^
a4cec2f ^

61845c3 ^
96df187 ^
66b17d7 ^

d043745 ^
d202e2c ^


ec410d5 ^

96df187 ^
ec410d5 ^

d622043 ^

96df187 ^
d622043 ^
ec410d5 ^
96df187 ^
c188cd3 ^

53def09 ^



ac83252 ^



f0e967d ^












bc46cef ^
f0e967d ^

cad09c0 ^



f0e967d ^


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123