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