https://github.com/akkartik/mu/blob/main/baremetal/120allocate.subx
1 == code
2
3
4
5
6
7 zero-out:
8
9
10
11
12
13
14
15
16
17
18 55/push-ebp
19 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
20
21 50/push-eax
22 51/push-ecx
23 52/push-edx
24 56/push-esi
25
26 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 6/r32/esi 8/disp8 .
27
28 31/xor 3/mod/direct 1/rm32/ecx . . . 1/r32/ecx . .
29
30 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 2/r32/edx 0xc/disp8 .
31 $zero-out:loop:
32
33 39/compare 3/mod/direct 1/rm32/ecx . . . 2/r32/edx . .
34 7d/jump-if->= $zero-out:end/disp8
35
36 c6 0/subop/copy-byte 0/mod/direct 6/rm32/esi . . . . . 0/imm8
37
38 46/increment-esi
39
40 41/increment-ecx
41 eb/jump $zero-out:loop/disp8
42 $zero-out:end:
43
44 5e/pop-to-esi
45 5a/pop-to-edx
46 59/pop-to-ecx
47 58/pop-to-eax
48
49 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
50 5d/pop-to-ebp
51 c3/return
52
53