https://github.com/akkartik/mu/blob/main/110stop.subx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35 == code
36
37
38
39
40
41
42
43
44 tailor-exit-descriptor:
45
46 55/push-ebp
47 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
48
49 50/push-eax
50 51/push-ecx
51
52 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 0/r32/eax 0xc/disp8 .
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76 f7 3/subop/negate 3/mod/direct 0/rm32/eax . . . . . .
77 8d/copy-address 1/mod/*+disp8 4/rm32/sib 5/base/ebp 0/index/eax . 0/r32/eax 0xc/disp8 .
78
79 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 1/r32/ecx 8/disp8 .
80 89/copy 0/mod/indirect 1/rm32/ecx . . . 0/r32/eax . .
81
82 c7 0/subop/copy 1/mod/*+disp8 1/rm32/ecx . . . . 4/disp8 0/imm32
83 $tailor-exit-descriptor:end:
84
85 59/pop-to-ecx
86 58/pop-to-eax
87
88 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . .
89 5d/pop-to-ebp
90 c3/return
91
92 stop:
93
94
95 8b/copy 1/mod/*+disp8 4/rm32/sib 4/base/esp 4/index/none . 0/r32/eax 4/disp8 .
96
97 3d/compare-eax-and 0/imm32
98 74/jump-if-= $stop:real/disp8
99
100 81 7/subop/compare 0/mod/indirect 0/rm32/eax . . . . . 0/imm32
101 74/jump-if-= $stop:real/disp8
102 $stop:fake:
103
104 8b/copy 1/mod/*+disp8 4/rm32/sib 4/base/esp 4/index/none . 1/r32/ecx 8/disp8 .
105 41/increment-ecx
106 89/copy 1/mod/*+disp8 0/rm32/eax . . . 1/r32/ecx 4/disp8 .
107
108 8b/copy 0/mod/indirect 0/rm32/eax . . . 4/r32/esp . .
109 $stop:end1:
110
111 c3/return
112 $stop:real:
113
114 8b/copy 1/mod/*+disp8 4/rm32/sib 4/base/esp 4/index/none . 3/r32/ebx 8/disp8 .
115 e8/call syscall_exit/disp32
116 $stop:end2:
117
118 c3/return
119
120 test-stop-skips-returns-on-exit:
121
122
123
124
125
126
127 55/push-ebp
128 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
129
130
131
132
133 68/push 0/imm32
134 68/push 0/imm32
135 89/copy 3/mod/direct 0/rm32/eax . . . 4/r32/esp . .
136
137
138
139 68/push 4/imm32/nbytes-of-args-for-_test-stop-1
140 50/push-eax
141
142 e8/call tailor-exit-descriptor/disp32
143
144 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
145
146
147 50/push-eax
148
149 e8/call _test-stop-1/disp32
150
151
152 58/pop-to-eax
153
154
155
156 68/push "F - test-stop-skips-returns-on-exit"/imm32
157 68/push 2/imm32
158
159 ff 6/subop/push 1/mod/*+disp8 0/rm32/eax . . . . 4/disp8 .
160
161 e8/call check-ints-equal/disp32
162
163 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32
164
165
166 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32
167 5d/pop-to-ebp
168 c3/return
169
170 _test-stop-1:
171
172 55/push-ebp
173 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . .
174
175
176 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 .
177
178 e8/call _test-stop-2/disp32
179
180 $_test-stop-1:dead-end:
181
182 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32
183
184
185 68/push "F - test-stop-skips-returns-on-exit"/imm32
pre { line-height: 125%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.highlight .hll { background-color: #ffffcc }
.highlight .c { color: #888888 } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { color: #008800; font-weight: bold } /* Keyword */
.highlight .ch { color: #888888 } /* Comment.Hashbang */
.highlight .cm { color: #888888 } /* Comment.Multiline */
.highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */
.highlight .cpf { color: #888888 } /* Comment.PreprocFile */
.highlight .c1 { color: #888888 } /* Comment.Single */
.highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */
.highlight .gr { color: #aa0000 } /* Generic.Error */
.highlight .gh { color: #333333 } /* Generic.Heading */
.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
.highlight .go { color: #888888 } /* Generic.Output */
.highlight .gp { color: #555555 } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #666666 } /* Generic.Subheading */
.highlight .gt { color: #aa0000 } /* Generic.Traceback */
.highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */
.highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */
.highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */
.highlight .kp { color: #008800 } /* Keyword.Pseudo */
.highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */
.highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */
.highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */
.highlight .na { color: #336699 } /* Name.Attribute */
.highlight .nb { color: #003388 } /* Name.Builtin */
.highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */
.highlight .no { color: #003366; font-weight: bold } /* Name.Constant */
.highlight .nd { color: #555555 } /* Name.Decorator */
.highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */
.highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */
.highlight .nl { color: #336699; font-style: italic } /* Name.Label */
.highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */
.highlight .py { color: #336699; font-weight: bold } /* Name.Property */
.highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */
.highlight .nv { color: #336699 } /* Name.Variable */
.highlight .ow { color: #008800 } /* Operator.Word */
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
.highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */
.highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */
.highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */
.highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */
.highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */
.highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */
.highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */
.highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */
.highlight .dl { color: #dd2200; b