https://github.com/akkartik/mu/blob/main/baremetal/103grapheme.subx
1 draw-grapheme:
2
3 55/push-ebp
4 89/<- %ebp 4/r32/esp
5
6 50/push-eax
7 51/push-ecx
8 52/push-edx
9 53/push-ebx
10 56/push-esi
11
12
13 8b/-> *(ebp+0xc) 6/r32/esi
14 c1 4/subop/shift-left %esi 4/imm8
15 8d/copy-address *(esi+0x8800) 6/r32/esi
16
17 81 7/subop/compare %esi 0x9000/imm32
18 7d/jump-if->= $draw-grapheme:end/disp8
19
20 8b/-> *(ebp+0x14) 2/r32/edx
21
22 8b/-> *(ebp+0x14) 3/r32/ebx
23 81 0/subop/add %ebx 0x10/imm32
24 {
25
26 39/compare %edx 3/r32/ebx
27 7d/jump-if->= break/disp8
28
29 8b/-> *(ebp+0x10) 0/r32/eax
30 81 0/subop/add %eax 7/imm32
31
32 8b/-> *(ebp+0x10) 1/r32/ecx
33
34 53/push-ebx
35 8b/-> *esi 3/r32/ebx
36 {
37
38 39/compare %eax 1/r32/ecx
39 7c/jump-if-< break/disp8
40
41 c1 5/subop/shift-right-logical %ebx 1/imm8
42
43 {
44 73/jump-if-not-CF break/disp8
45 (pixel *(ebp+8) %eax %edx *(ebp+0x18))
46 }
47
48 48/decrement-eax
49
50 eb/jump loop/disp8
51 }
52
53 5b/pop-to-ebx
54
55 42/increment-edx
56
57 46/increment-esi
58
59 eb/jump loop/disp8
60 }
61 $draw-grapheme:end:
62
63 5e/pop-to-esi
64 5b/pop-to-ebx
65 5a/pop-to-edx
66 59/pop-to-ecx
67 58/pop-to-eax
68
69 89/<- %esp 5/r32/ebp
70 5d/pop-to-ebp
71 c3/return
72
73 cursor-position:
74
75 55/push-ebp
76 89/<- %ebp 4/r32/esp
77
78 8b/-> *Default-next-x 0/r32/eax
79 8b/-> *Default-next-y 1/r32/ecx
80 $cursor-position:end:
81
82 89/<- %esp 5/r32/ebp
83 5d/pop-to-ebp
84 c3/return
85
86 set-cursor-position:
87
88 55/push-ebp
89 89/<- %ebp 4/r32/esp
90
91 50/push-eax
92
93 8b/-> *(ebp+0xc) 0/r32/eax
94 89/<- *Default-next-x 0/r32/eax
95 8b/-> *(ebp+0x10) 0/r32/eax
96 89/<- *Default-next-y 0/r32/eax
97 $set-cursor-position:end:
98
99 58/pop-to-eax
100
101 89/<- %esp 5/r32/ebp
102 5d/pop-to-ebp
103 c3/return
104
105 == data
106
107 Default-next-x:
108 0/imm32
109
110 Default-next-y:
111 0/imm32