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 8b/-> *(ebp+0xc) 6/r32/esi
13 c1 4/subop/shift-left %esi 4/imm8
14 8d/copy-address *(esi+0x8800) 6/r32/esi
15
16 81 7/subop/compare %esi 0x9000/imm32
17 7d/jump-if->= $draw-grapheme:end/disp8
18
19 8b/-> *(ebp+0x14) 2/r32/edx
20
21 8b/-> *(ebp+0x14) 3/r32/ebx
22 81 0/subop/add %ebx 0x10/imm32
23 {
24
25 39/compare %edx 3/r32/ebx
26 7d/jump-if->= break/disp8
27
28 8b/-> *(ebp+0x10) 0/r32/eax
29 81 0/subop/add %eax 7/imm32
30
31 8b/-> *(ebp+0x10) 1/r32/ecx
32
33 53/push-ebx
34 8b/-> *esi 3/r32/ebx
35 {
36
37 39/compare %eax 1/r32/ecx
38 7c/jump-if-< break/disp8
39
40 c1 5/subop/shift-right-logical %ebx 1/imm8
41
42 {
43 73/jump-if-not-CF break/disp8
44 (pixel *(ebp+8) %eax %edx *(ebp+0x18))
45 }
46
47 48/decrement-eax
48
49 eb/jump loop/disp8
50 }
51
52 5b/pop-to-ebx
53
54 42/increment-edx
55
56 46/increment-esi
57
58 eb/jump loop/disp8
59 }
60 $draw-grapheme:end:
61
62 5e/pop-to-esi
63 5b/pop-to-ebx
64 5a/pop-to-edx
65 59/pop-to-ecx
66 58/pop-to-eax
67
68 89/<- %esp 5/r32/ebp
69 5d/pop-to-ebp
70 c3/return