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