https://github.com/akkartik/mu/blob/main/baremetal/103grapheme.subx
1
2
3
4
5
6
7
8
9
10 == code
11
12
13
14
15 draw-grapheme-on-real-screen:
16
17 55/push-ebp
18 89/<- %ebp 4/r32/esp
19
20 50/push-eax
21 51/push-ecx
22 52/push-edx
23 53/push-ebx
24 56/push-esi
25
26 8b/-> *(ebp+8) 6/r32/esi
27 c1 4/subop/shift-left %esi 4/imm8
28 8d/copy-address *(esi+0x8c00) 6/r32/esi
29
30 81 7/subop/compare %esi 0x9400/imm32
31 7d/jump-if->= $draw-grapheme-on-real-screen:end/disp8
32
33 8b/-> *(ebp+0x10) 2/r32/edx
34 c1 4/subop/shift-left %edx 4/imm8
35
36 8b/-> *(ebp+0x10) 3/r32/ebx
37 c1 4/subop/shift-left %ebx 4/imm8
38 81 0/subop/add %ebx 0x10/imm32
39 {
40
41 39/compare %edx 3/r32/ebx
42 7d/jump-if->= break/disp8
43
44 8b/-> *(ebp+0xc) 0/r32/eax
45 c1 4/subop/shift-left %eax 3/imm8
46 81 0/subop/add %eax 7/imm32
47
48 8b/-> *(ebp+0xc) 1/r32/ecx
49 c1 4/subop/shift-left %ecx 3/imm8
50
51 53/push-ebx
52 8b/-> *esi 3/r32/ebx
53 {
54
55 39/compare %eax 1/r32/ecx
56 7c/jump-if-< break/disp8
57
58 c1 5/subop/shift-right-logical %ebx 1/imm8
59
60 {
61 73/jump-if-not-CF break/disp8
62 (pixel-on-real-screen %eax %edx *(ebp+0x14))
63 eb/jump $draw-grapheme-on-real-screen:continue/disp8
64 }
65
66 (pixel-on-real-screen %eax %edx *(ebp+0x18))
67 $draw-grapheme-on-real-screen:continue:
68
69 48/decrement-eax
70
71 eb/jump loop/disp8
72 }
73
74 5b/pop-to-ebx
75
76 42/increment-edx
77
78 46/increment-esi
79
80 eb/jump loop/disp8
81 }
82 $draw-grapheme-on-real-screen:end:
83
84 5e/pop-to-esi
85 5b/pop-to-ebx
86 5a/pop-to-edx
87 59/pop-to-ecx
88 58/pop-to-eax
89
90 89/<- %esp 5/r32/ebp
91 5d/pop-to-ebp
92 c3/return
93
94 cursor-position-on-real-screen:
95
96 55/push-ebp
97 89/<- %ebp 4/r32/esp
98
99 8b/-> *Real-screen-cursor-x 0/r32/eax
100 8b/-> *Real-screen-cursor-y 1/r32/ecx
101 $cursor-position-on-real-screen:end:
102
103 89/<- %esp 5/r32/ebp
104 5d/pop-to-ebp
105 c3/return
106
107 set-cursor-position-on-real-screen:
108
109 55/push-ebp
110 89/<- %ebp 4/r32/esp
111
112 50/push-eax
113
114 8b/-> *(ebp+8) 0/r32/eax
115 89/<- *Real-screen-cursor-x 0/r32/eax
116 8b/-> *(ebp+0xc) 0/r32/eax
117 89/<- *Real-screen-cursor-y 0/r32/eax
118 $set-cursor-position-on-real-screen:end:
119
120 58/pop-to-eax
121
122 89/<- %esp 5/r32/ebp
123 5d/pop-to-ebp
124 c3/return
125
126
127
128
129
130
131 show-cursor-on-real-screen:
132
133 55/push-ebp
134 89/<- %ebp 4/r32/esp
135
136 50/push-eax
137 51/push-ecx
138
139 (cursor-position-on-real-screen)
140 (draw-grapheme-on-real-screen *(ebp+8) %eax %ecx 0 7)
141 $show-cursor-on-real-screen:end:
142
143 59/pop-to-ecx
144 58/pop-to-eax
145
146 89/<- %esp 5/r32/ebp
147 5d/pop-to-ebp
148 c3/return
149
150 == data
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167 Real-screen-cursor-x:
168 0/imm32
169 Real-screen-cursor-y:
170 0/imm32