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