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