https://github.com/akkartik/mu/blob/master/076zero-out.subx
1
2
3 == code
4
5
6
7
8 zero-out:
9
10
11
12
13
14
15
16
17
18
19 55/push-ebp
20 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
21
22 50/push-eax
23 51/push-ecx
24 52/push-edx
25 56/push-esi
26
27 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 6/r32/esi 8/disp8 .
28
29 31/xor 3/mod/direct 1/rm32/ecx . . . 1/r32/ecx . .
30
31 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 2/r32/edx 0xc/disp8 .
32 $zero-out:loop:
33
34 39/compare 3/mod/direct 1/rm32/ecx . . . 2/r32/edx . .
35 7d/jump-if-greater-or-equal $zero-out:end/disp8
36
37 c6 0/subop/copy 0/mod/direct 6/rm32/esi . . . . . 0/imm8
38
39 46/increment-esi
40
41 41/increment-ecx
42 eb/jump $zero-out:loop/disp8
43 $zero-out:end:
44
45 5e/pop-to-esi
46 5a/pop-to-edx
47 59/pop-to-ecx
48 58/pop-to-eax
49
50 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
51 5d/pop-to-ebp
52 c3/return
53
54 test-zero-out:
55
56 55/push-ebp
57 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
58
59 68/push 0x37363534/imm32
60 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . .
61
62
63 68/push 3/imm32/len
64 51/push-ecx
65
66 e8/call zero-out/disp32
67
68 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
69
70
71
72 68/push "F - test-zero-out"/imm32
73 68/push 0x37000000/imm32
74 ff 6/subop/push 0/mod/indirect 1/rm32/ecx . . . . . .
75
76 e8/call check-ints-equal/disp32
77
78 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
79
80 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
81 5d/pop-to-ebp
82 c3/return
83
84