Mercurial > pub > dyncall > dyncall
comparison doc/disas_examples/x86.cdecl.disas @ 327:c0390dc85a07
- doc: added disassembly examples for many platforms and calling conventions, for reference
author | Tassilo Philipp |
---|---|
date | Fri, 22 Nov 2019 23:08:59 +0100 |
parents | |
children | 984e6652b975 |
comparison
equal
deleted
inserted
replaced
326:09aaa2e774cd | 327:c0390dc85a07 |
---|---|
1 ; #include <stdlib.h> | |
2 ; | |
3 ; void leaf_call(int b, int c, int d, int e, int f, int g, int h) | |
4 ; { | |
5 ; } | |
6 ; | |
7 ; void nonleaf_call(int a, int b, int c, int d, int e, int f, int g, int h) | |
8 ; { | |
9 ; /* use some local data */ | |
10 ; *(char*)alloca(220) = 'L'; | |
11 ; leaf_call(b, c, d, e, f, g, h); | |
12 ; } | |
13 ; | |
14 ; int main() | |
15 ; { | |
16 ; nonleaf_call(0, 1, 2, 3, 4, 5, 6, 7); | |
17 ; return 0; | |
18 ; } | |
19 | |
20 | |
21 | |
22 ; output from arch_linux-2011.08.19-x86 w/ gcc 4.6.1 | |
23 | |
24 00000000 <leaf_call>: | |
25 0: 55 push %ebp | |
26 1: 89 e5 mov %esp,%ebp | |
27 3: 5d pop %ebp | |
28 4: c3 ret | |
29 | |
30 00000005 <nonleaf_call>: | |
31 5: 55 push %ebp ; | | |
32 6: 89 e5 mov %esp,%ebp ; | prolog | |
33 8: 83 ec 38 sub $0x38,%esp ; / | |
34 b: b8 10 00 00 00 mov $0x10,%eax ; \ | | |
35 10: 83 e8 01 sub $0x1,%eax ; | | creative way to move 250 to eax | |
36 13: 05 eb 00 00 00 add $0xeb,%eax ; | / | |
37 18: c7 45 f4 10 00 00 00 movl $0x10,-0xc(%ebp) ; | size comp wtf? \ | |
38 1f: ba 00 00 00 00 mov $0x0,%edx ; | | | |
39 24: f7 75 f4 divl -0xc(%ebp) ; | | obviously fastest way to round to multiple of 16 | |
40 27: 6b c0 10 imul $0x10,%eax,%eax ; | | | |
41 2a: 29 c4 sub %eax,%esp ; alloca(220) with size containing some padding computed above | |
42 2c: 8d 44 24 1c lea 0x1c(%esp),%eax ; | | |
43 30: 83 c0 0f add $0xf,%eax ; | start of alloca()'d memory -> eax, by ... | |
44 33: c1 e8 04 shr $0x4,%eax ; | ... using ebx and 2 pointless store/reads in local space as helper to align to 16b | |
45 36: c1 e0 04 shl $0x4,%eax ; | | |
46 39: c6 00 4c movb $0x4c,(%eax) ; 'L' -> alloca()'d space | |
47 3c: 8b 45 24 mov 0x24(%ebp),%eax ; | | |
48 3f: 89 44 24 18 mov %eax,0x18(%esp) ; | | |
49 43: 8b 45 20 mov 0x20(%ebp),%eax ; | | |
50 46: 89 44 24 14 mov %eax,0x14(%esp) ; | | |
51 4a: 8b 45 1c mov 0x1c(%ebp),%eax ; | | |
52 4d: 89 44 24 10 mov %eax,0x10(%esp) ; | | |
53 51: 8b 45 18 mov 0x18(%ebp),%eax ; | read in args 1-7 from prev frame's param area, and ... | |
54 54: 89 44 24 0c mov %eax,0xc(%esp) ; | ... "push" onto stack as arg 0-6 | |
55 58: 8b 45 14 mov 0x14(%ebp),%eax ; | | |
56 5b: 89 44 24 08 mov %eax,0x8(%esp) ; | | |
57 5f: 8b 45 10 mov 0x10(%ebp),%eax ; | | |
58 62: 89 44 24 04 mov %eax,0x4(%esp) ; | | |
59 66: 8b 45 0c mov 0xc(%ebp),%eax ; | | |
60 69: 89 04 24 mov %eax,(%esp) ; | | |
61 6c: e8 fc ff ff ff call 6d <nonleaf_call+0x68> ; push return address and call leaf_call (objdump not from final link but .o) | |
62 71: c9 leave ; | | |
63 72: c3 ret ; | epilog | |
64 | |
65 00000073 <main>: | |
66 73: 55 push %ebp ; | | |
67 74: 89 e5 mov %esp,%ebp ; | | |
68 76: 83 e4 f0 and $0xfffffff0,%esp ; | prolog | |
69 79: 83 ec 20 sub $0x20,%esp ; | | |
70 7c: c7 44 24 1c 07 00 00 00 movl $0x7,0x1c(%esp) ; arg 7 -> stack | |
71 84: c7 44 24 18 06 00 00 00 movl $0x6,0x18(%esp) ; arg 6 -> stack | |
72 8c: c7 44 24 14 05 00 00 00 movl $0x5,0x14(%esp) ; arg 5 -> stack | |
73 94: c7 44 24 10 04 00 00 00 movl $0x4,0x10(%esp) ; arg 4 -> stack | |
74 9c: c7 44 24 0c 03 00 00 00 movl $0x3,0xc(%esp) ; arg 3 -> stack | |
75 a4: c7 44 24 08 02 00 00 00 movl $0x2,0x8(%esp) ; arg 2 -> stack | |
76 ac: c7 44 24 04 01 00 00 00 movl $0x1,0x4(%esp) ; arg 1 -> stack | |
77 b4: c7 04 24 00 00 00 00 movl $0x0,(%esp) ; arg 0 -> stack | |
78 bb: e8 fc ff ff ff call bc <main+0x49> ; push return address and call nonleaf_call (objdump not from final link but .o) | |
79 c0: b8 00 00 00 00 mov $0x0,%eax ; return value | |
80 c5: c9 leave ; | | |
81 c6: c3 ret ; | epilog | |
82 | |
83 | |
84 | |
85 ; output from darwin-8.0.1-x86 w/ gcc 3.3 | |
86 | |
87 _leaf_call: | |
88 0: 55 pushl %ebp | |
89 1: 89 e5 movl %esp, %ebp | |
90 3: 83 ec 08 subl $8, %esp | |
91 6: c9 leave | |
92 7: c3 retl | |
93 | |
94 _nonleaf_call: | |
95 8: 55 pushl %ebp ; | | |
96 9: 89 e5 movl %esp, %ebp ; | prolog | |
97 b: 83 ec 28 subl $40, %esp ; | | |
98 e: 81 ec e0 00 00 00 subl $224, %esp ; alloca(220) - with 4b padding | |
99 14: 8d 44 24 20 leal 32(%esp), %eax ; | | |
100 18: c6 00 4c movb $76, (%eax) ; / 'L' -> alloca()'d space | |
101 1b: 8b 45 24 movl 36(%ebp), %eax ; \ | |
102 1e: 89 44 24 18 movl %eax, 24(%esp) ; | | |
103 22: 8b 45 20 movl 32(%ebp), %eax ; | | |
104 25: 89 44 24 14 movl %eax, 20(%esp) ; | | |
105 29: 8b 45 1c movl 28(%ebp), %eax ; | | |
106 2c: 89 44 24 10 movl %eax, 16(%esp) ; | | |
107 30: 8b 45 18 movl 24(%ebp), %eax ; | read in args 1-7 from prev frame's param area, and ... | |
108 33: 89 44 24 0c movl %eax, 12(%esp) ; | ... "push" onto stack as arg 0-6 | |
109 37: 8b 45 14 movl 20(%ebp), %eax ; | | |
110 3a: 89 44 24 08 movl %eax, 8(%esp) ; | | |
111 3e: 8b 45 10 movl 16(%ebp), %eax ; | | |
112 41: 89 44 24 04 movl %eax, 4(%esp) ; | | |
113 45: 8b 45 0c movl 12(%ebp), %eax ; | | |
114 48: 89 04 24 movl %eax, (%esp) ; | | |
115 4b: e8 b0 ff ff ff calll -80 <_leaf_call> ; push return address and call | |
116 50: c9 leave ; | | |
117 51: c3 retl ; | epilog | |
118 52: 90 nop ; | |
119 53: 90 nop ; | |
120 | |
121 _main: | |
122 54: 55 pushl %ebp ; | | |
123 55: 89 e5 movl %esp, %ebp ; | prolog | |
124 57: 83 ec 28 subl $40, %esp ; | | |
125 5a: c7 44 24 1c 07 00 00 00 movl $7, 28(%esp) ; arg 7 -> stack | |
126 62: c7 44 24 18 06 00 00 00 movl $6, 24(%esp) ; arg 6 -> stack | |
127 6a: c7 44 24 14 05 00 00 00 movl $5, 20(%esp) ; arg 5 -> stack | |
128 72: c7 44 24 10 04 00 00 00 movl $4, 16(%esp) ; arg 4 -> stack | |
129 7a: c7 44 24 0c 03 00 00 00 movl $3, 12(%esp) ; arg 3 -> stack | |
130 82: c7 44 24 08 02 00 00 00 movl $2, 8(%esp) ; arg 2 -> stack | |
131 8a: c7 44 24 04 01 00 00 00 movl $1, 4(%esp) ; arg 1 -> stack | |
132 92: c7 04 24 00 00 00 00 movl $0, (%esp) ; arg 0 -> stack | |
133 99: e8 6a ff ff ff calll -150 <_nonleaf_call> ; push return address and call | |
134 9e: b8 00 00 00 00 movl $0, %eax ; return value | |
135 a3: c9 leave ; | | |
136 a4: c3 retl ; | epilog | |
137 | |
138 | |
139 | |
140 ; output from freebsd-9.3-x86 w/ gcc 4.2.1 | |
141 | |
142 00000000 <leaf_call>: | |
143 0: 55 push %ebp | |
144 1: 89 e5 mov %esp,%ebp | |
145 3: 5d pop %ebp | |
146 4: c3 ret | |
147 5: 8d 74 26 00 lea 0x0(%esi),%esi | |
148 9: 8d bc 27 00 00 00 00 lea 0x0(%edi),%edi | |
149 | |
150 00000010 <nonleaf_call>: | |
151 10: 55 push %ebp ; | | |
152 11: 89 e5 mov %esp,%ebp ; | prolog | |
153 13: 83 ec 28 sub $0x28,%esp ; | | |
154 16: 81 ec f0 00 00 00 sub $0xf0,%esp ; alloca(220) - with padding for 16b alignment | |
155 1c: 8d 44 24 1c lea 0x1c(%esp),%eax ; | | |
156 20: 89 45 fc mov %eax,-0x4(%ebp) ; | | |
157 23: 8b 45 fc mov -0x4(%ebp),%eax ; | | |
158 26: 83 c0 0f add $0xf,%eax ; | start of alloca()'d memory -> eax, by ... | |
159 29: c1 e8 04 shr $0x4,%eax ; | ... using ebx and 2 pointless store/reads in local space as helper to align to 16b | |
160 2c: c1 e0 04 shl $0x4,%eax ; | | |
161 2f: 89 45 fc mov %eax,-0x4(%ebp) ; | | |
162 32: 8b 45 fc mov -0x4(%ebp),%eax ; | | |
163 35: c6 00 4c movb $0x4c,(%eax) ; 'L' -> alloca()'d space | |
164 38: 8b 45 24 mov 0x24(%ebp),%eax ; | | |
165 3b: 89 44 24 18 mov %eax,0x18(%esp) ; | | |
166 3f: 8b 45 20 mov 0x20(%ebp),%eax ; | | |
167 42: 89 44 24 14 mov %eax,0x14(%esp) ; | | |
168 46: 8b 45 1c mov 0x1c(%ebp),%eax ; | | |
169 49: 89 44 24 10 mov %eax,0x10(%esp) ; | | |
170 4d: 8b 45 18 mov 0x18(%ebp),%eax ; | read in args 1-7 from prev frame's param area, and ... | |
171 50: 89 44 24 0c mov %eax,0xc(%esp) ; | ... "push" onto stack as arg 0-6 | |
172 54: 8b 45 14 mov 0x14(%ebp),%eax ; | | |
173 57: 89 44 24 08 mov %eax,0x8(%esp) ; | | |
174 5b: 8b 45 10 mov 0x10(%ebp),%eax ; | | |
175 5e: 89 44 24 04 mov %eax,0x4(%esp) ; | | |
176 62: 8b 45 0c mov 0xc(%ebp),%eax ; | | |
177 65: 89 04 24 mov %eax,(%esp) ; | | |
178 68: e8 fc ff ff ff call 69 <nonleaf_call+0x59> ; push return address and call leaf_call (objdump not from final link but .o) | |
179 6d: c9 leave ; | | |
180 6e: c3 ret ; | epilog | |
181 6f: 90 nop ; | |
182 | |
183 00000070 <main>: | |
184 70: 8d 4c 24 04 lea 0x4(%esp),%ecx ; | | |
185 74: 83 e4 f0 and $0xfffffff0,%esp ; | | |
186 77: ff 71 fc pushl -0x4(%ecx) ; | | |
187 7a: 55 push %ebp ; | prolog | |
188 7b: 89 e5 mov %esp,%ebp ; | | |
189 7d: 51 push %ecx ; | | |
190 7e: 83 ec 24 sub $0x24,%esp ; | | |
191 81: c7 44 24 1c 07 00 00 00 movl $0x7,0x1c(%esp) ; arg 7 -> stack | |
192 89: c7 44 24 18 06 00 00 00 movl $0x6,0x18(%esp) ; arg 6 -> stack | |
193 91: c7 44 24 14 05 00 00 00 movl $0x5,0x14(%esp) ; arg 5 -> stack | |
194 99: c7 44 24 10 04 00 00 00 movl $0x4,0x10(%esp) ; arg 4 -> stack | |
195 a1: c7 44 24 0c 03 00 00 00 movl $0x3,0xc(%esp) ; arg 3 -> stack | |
196 a9: c7 44 24 08 02 00 00 00 movl $0x2,0x8(%esp) ; arg 2 -> stack | |
197 b1: c7 44 24 04 01 00 00 00 movl $0x1,0x4(%esp) ; arg 1 -> stack | |
198 b9: c7 04 24 00 00 00 00 movl $0x0,(%esp) ; arg 0 -> stack | |
199 c0: e8 fc ff ff ff call c1 <main+0x51> ; push return address and call leaf_call (objdump not from final link but .o) | |
200 c5: b8 00 00 00 00 mov $0x0,%eax ; return value | |
201 ca: 83 c4 24 add $0x24,%esp ; | | |
202 cd: 59 pop %ecx ; | | |
203 ce: 5d pop %ebp ; | epilog | |
204 cf: 8d 61 fc lea -0x4(%ecx),%esp ; | | |
205 d2: c3 ret ; | | |
206 | |
207 | |
208 | |
209 ; output from gentoo_linux-20191029-x86 w/ gcc 8.3.0 | |
210 | |
211 00000000 <leaf_call>: | |
212 0: 55 push %ebp | |
213 1: 89 e5 mov %esp,%ebp | |
214 3: e8 fc ff ff ff call 4 <leaf_call+0x4> | |
215 8: 05 01 00 00 00 add $0x1,%eax | |
216 d: 90 nop | |
217 e: 5d pop %ebp | |
218 f: c3 ret | |
219 | |
220 00000010 <nonleaf_call>: | |
221 10: 55 push %ebp | |
222 11: 89 e5 mov %esp,%ebp | |
223 13: 83 ec 18 sub $0x18,%esp | |
224 16: e8 fc ff ff ff call 17 <nonleaf_call+0x7> | |
225 1b: 05 01 00 00 00 add $0x1,%eax | |
226 20: 65 a1 14 00 00 00 mov %gs:0x14,%eax | |
227 26: 89 45 f4 mov %eax,-0xc(%ebp) | |
228 29: 31 c0 xor %eax,%eax | |
229 2b: b8 10 00 00 00 mov $0x10,%eax | |
230 30: 48 dec %eax | |
231 31: 05 e8 00 00 00 add $0xe8,%eax | |
232 36: b9 10 00 00 00 mov $0x10,%ecx | |
233 3b: ba 00 00 00 00 mov $0x0,%edx | |
234 40: f7 f1 div %ecx | |
235 42: 6b c0 10 imul $0x10,%eax,%eax | |
236 45: 29 c4 sub %eax,%esp | |
237 47: 89 e0 mov %esp,%eax | |
238 49: 83 c0 0f add $0xf,%eax | |
239 4c: c1 e8 04 shr $0x4,%eax | |
240 4f: c1 e0 04 shl $0x4,%eax | |
241 52: c6 00 4c movb $0x4c,(%eax) | |
242 55: 83 ec 04 sub $0x4,%esp | |
243 58: ff 75 24 pushl 0x24(%ebp) | |
244 5b: ff 75 20 pushl 0x20(%ebp) | |
245 5e: ff 75 1c pushl 0x1c(%ebp) | |
246 61: ff 75 18 pushl 0x18(%ebp) | |
247 64: ff 75 14 pushl 0x14(%ebp) | |
248 67: ff 75 10 pushl 0x10(%ebp) | |
249 6a: ff 75 0c pushl 0xc(%ebp) | |
250 6d: e8 fc ff ff ff call 6e <nonleaf_call+0x5e> | |
251 72: 83 c4 20 add $0x20,%esp | |
252 75: 90 nop | |
253 76: 8b 45 f4 mov -0xc(%ebp),%eax | |
254 79: 65 33 05 14 00 00 00 xor %gs:0x14,%eax | |
255 80: 74 05 je 87 <nonleaf_call+0x77> | |
256 82: e8 fc ff ff ff call 83 <nonleaf_call+0x73> | |
257 87: c9 leave | |
258 88: c3 ret | |
259 | |
260 00000089 <main>: | |
261 89: 8d 4c 24 04 lea 0x4(%esp),%ecx ; | | |
262 8d: 83 e4 f0 and $0xfffffff0,%esp ; | | |
263 90: ff 71 fc pushl -0x4(%ecx) ; | | |
264 93: 55 push %ebp ; | | |
265 94: 89 e5 mov %esp,%ebp ; | prolog (with some stack protection check call, I think) | |
266 96: 51 push %ecx ; | | |
267 97: 83 ec 04 sub $0x4,%esp ; | | |
268 9a: e8 fc ff ff ff call 9b <main+0x12> ; | unsure@@@ call of stackguard stuff, maybe?. (objdump not from final link but .o) | |
269 9f: 05 01 00 00 00 add $0x1,%eax ; | ??? add 1 to ret val from unknown call | |
270 a4: 6a 07 push $0x7 ; arg 7 -> stack | |
271 a6: 6a 06 push $0x6 ; arg 6 -> stack | |
272 a8: 6a 05 push $0x5 ; arg 5 -> stack | |
273 aa: 6a 04 push $0x4 ; arg 4 -> stack | |
274 ac: 6a 03 push $0x3 ; arg 3 -> stack | |
275 ae: 6a 02 push $0x2 ; arg 2 -> stack | |
276 b0: 6a 01 push $0x1 ; arg 1 -> stack | |
277 b2: 6a 00 push $0x0 ; arg 0 -> stack | |
278 b4: e8 fc ff ff ff call b5 <main+0x2c> ; push return address and call nonleaf_call (objdump not from final link but .o) | |
279 b9: 83 c4 20 add $0x20,%esp ; ??? | |
280 bc: b8 00 00 00 00 mov $0x0,%eax ; return value | |
281 c1: 8b 4d fc mov -0x4(%ebp),%ecx ; | ??? | |
282 c4: c9 leave ; | | |
283 c5: 8d 61 fc lea -0x4(%ecx),%esp ; | epilog ??? | |
284 c8: c3 ret ; | | |
285 | |
286 | |
287 | |
288 ; output from haiku w/ gcc 4.4.4 | |
289 | |
290 00000000 <leaf_call>: | |
291 0: 55 push %ebp | |
292 1: 89 e5 mov %esp,%ebp | |
293 3: 5d pop %ebp | |
294 4: c3 ret | |
295 | |
296 00000005 <nonleaf_call>: | |
297 5: 55 push %ebp | |
298 6: 89 e5 mov %esp,%ebp | |
299 8: 53 push %ebx | |
300 9: 83 ec 04 sub $0x4,%esp | |
301 c: e8 00 00 00 00 call 11 <nonleaf_call+0xc> | |
302 11: 5b pop %ebx | |
303 12: 81 c3 03 00 00 00 add $0x3,%ebx | |
304 18: 81 ec f0 00 00 00 sub $0xf0,%esp | |
305 1e: 89 e0 mov %esp,%eax | |
306 20: 83 c0 0f add $0xf,%eax | |
307 23: c1 e8 04 shr $0x4,%eax | |
308 26: c1 e0 04 shl $0x4,%eax | |
309 29: c6 00 4c movb $0x4c,(%eax) | |
310 2c: 83 ec 04 sub $0x4,%esp | |
311 2f: ff 75 24 pushl 0x24(%ebp) | |
312 32: ff 75 20 pushl 0x20(%ebp) | |
313 35: ff 75 1c pushl 0x1c(%ebp) | |
314 38: ff 75 18 pushl 0x18(%ebp) | |
315 3b: ff 75 14 pushl 0x14(%ebp) | |
316 3e: ff 75 10 pushl 0x10(%ebp) | |
317 41: ff 75 0c pushl 0xc(%ebp) | |
318 44: e8 fc ff ff ff call 45 <nonleaf_call+0x40> | |
319 49: 83 c4 20 add $0x20,%esp | |
320 4c: 8b 5d fc mov -0x4(%ebp),%ebx | |
321 4f: c9 leave | |
322 50: c3 ret | |
323 | |
324 00000051 <main>: | |
325 51: 8d 4c 24 04 lea 0x4(%esp),%ecx | |
326 55: 83 e4 f0 and $0xfffffff0,%esp | |
327 58: ff 71 fc pushl -0x4(%ecx) | |
328 5b: 55 push %ebp | |
329 5c: 89 e5 mov %esp,%ebp | |
330 5e: 53 push %ebx | |
331 5f: 51 push %ecx | |
332 60: e8 00 00 00 00 call 65 <main+0x14> | |
333 65: 5b pop %ebx | |
334 66: 81 c3 03 00 00 00 add $0x3,%ebx | |
335 6c: 6a 07 push $0x7 | |
336 6e: 6a 06 push $0x6 | |
337 70: 6a 05 push $0x5 | |
338 72: 6a 04 push $0x4 | |
339 74: 6a 03 push $0x3 | |
340 76: 6a 02 push $0x2 | |
341 78: 6a 01 push $0x1 | |
342 7a: 6a 00 push $0x0 | |
343 7c: e8 fc ff ff ff call 7d <main+0x2c> | |
344 81: 83 c4 20 add $0x20,%esp | |
345 84: b8 00 00 00 00 mov $0x0,%eax | |
346 89: 8d 65 f8 lea -0x8(%ebp),%esp | |
347 8c: 83 c4 00 add $0x0,%esp | |
348 8f: 59 pop %ecx | |
349 90: 5b pop %ebx | |
350 91: 5d pop %ebp | |
351 92: 8d 61 fc lea -0x4(%ecx),%esp | |
352 95: c3 ret | |
353 | |
354 | |
355 | |
356 ; output from nexenta-1.0.1-b85-x86 w/ gcc 4.0.3 | |
357 | |
358 00000000 <leaf_call>: | |
359 0: 55 push %ebp | |
360 1: 89 e5 mov %esp,%ebp | |
361 3: c9 leave | |
362 4: c3 ret | |
363 | |
364 00000005 <nonleaf_call>: | |
365 5: 55 push %ebp | |
366 6: 89 e5 mov %esp,%ebp | |
367 8: 83 ec 08 sub $0x8,%esp | |
368 b: 81 ec f0 00 00 00 sub $0xf0,%esp | |
369 11: 89 65 fc mov %esp,0xfffffffc(%ebp) | |
370 14: 8b 45 fc mov 0xfffffffc(%ebp),%eax | |
371 17: 83 c0 0f add $0xf,%eax | |
372 1a: c1 e8 04 shr $0x4,%eax | |
373 1d: c1 e0 04 shl $0x4,%eax | |
374 20: 89 45 fc mov %eax,0xfffffffc(%ebp) | |
375 23: 8b 45 fc mov 0xfffffffc(%ebp),%eax | |
376 26: c6 00 4c movb $0x4c,(%eax) | |
377 29: ff 75 24 pushl 0x24(%ebp) | |
378 2c: ff 75 20 pushl 0x20(%ebp) | |
379 2f: ff 75 1c pushl 0x1c(%ebp) | |
380 32: ff 75 18 pushl 0x18(%ebp) | |
381 35: ff 75 14 pushl 0x14(%ebp) | |
382 38: ff 75 10 pushl 0x10(%ebp) | |
383 3b: ff 75 0c pushl 0xc(%ebp) | |
384 3e: e8 fc ff ff ff call 3f <nonleaf_call+0x3a> | |
385 43: 83 c4 1c add $0x1c,%esp | |
386 46: c9 leave | |
387 47: c3 ret | |
388 | |
389 00000048 <main>: | |
390 48: 55 push %ebp | |
391 49: 89 e5 mov %esp,%ebp | |
392 4b: 83 ec 08 sub $0x8,%esp | |
393 4e: 83 e4 f0 and $0xfffffff0,%esp | |
394 51: b8 00 00 00 00 mov $0x0,%eax | |
395 56: 83 c0 0f add $0xf,%eax | |
396 59: 83 c0 0f add $0xf,%eax | |
397 5c: c1 e8 04 shr $0x4,%eax | |
398 5f: c1 e0 04 shl $0x4,%eax | |
399 62: 29 c4 sub %eax,%esp | |
400 64: 6a 07 push $0x7 | |
401 66: 6a 06 push $0x6 | |
402 68: 6a 05 push $0x5 | |
403 6a: 6a 04 push $0x4 | |
404 6c: 6a 03 push $0x3 | |
405 6e: 6a 02 push $0x2 | |
406 70: 6a 01 push $0x1 | |
407 72: 6a 00 push $0x0 | |
408 74: e8 fc ff ff ff call 75 <main+0x2d> | |
409 79: 83 c4 20 add $0x20,%esp | |
410 7c: b8 00 00 00 00 mov $0x0,%eax | |
411 81: c9 leave | |
412 82: c3 ret | |
413 | |
414 | |
415 | |
416 ; output from openbsd-4.0-x86 w/ gcc 3.3.5 (propolice) | |
417 | |
418 00000000 <leaf_call>: | |
419 0: 55 push %ebp | |
420 1: 89 e5 mov %esp,%ebp | |
421 3: c9 leave | |
422 4: c3 ret | |
423 | |
424 00000005 <nonleaf_call>: | |
425 5: 55 push %ebp | |
426 6: 89 e5 mov %esp,%ebp | |
427 8: 83 ec 18 sub $0x18,%esp | |
428 b: a1 00 00 00 00 mov 0x0,%eax | |
429 10: 89 45 e8 mov %eax,0xffffffe8(%ebp) | |
430 13: 81 ec e0 00 00 00 sub $0xe0,%esp | |
431 19: 89 e0 mov %esp,%eax | |
432 1b: c6 00 4c movb $0x4c,(%eax) | |
433 1e: 83 ec 04 sub $0x4,%esp | |
434 21: ff 75 24 pushl 0x24(%ebp) | |
435 24: ff 75 20 pushl 0x20(%ebp) | |
436 27: ff 75 1c pushl 0x1c(%ebp) | |
437 2a: ff 75 18 pushl 0x18(%ebp) | |
438 2d: ff 75 14 pushl 0x14(%ebp) | |
439 30: ff 75 10 pushl 0x10(%ebp) | |
440 33: ff 75 0c pushl 0xc(%ebp) | |
441 36: e8 fc ff ff ff call 37 <nonleaf_call+0x32> | |
442 3b: 83 c4 20 add $0x20,%esp | |
443 3e: 8b 45 e8 mov 0xffffffe8(%ebp),%eax | |
444 41: 3b 05 00 00 00 00 cmp 0x0,%eax | |
445 47: 74 13 je 5c <nonleaf_call+0x57> | |
446 49: 83 ec 08 sub $0x8,%esp | |
447 4c: ff 75 e8 pushl 0xffffffe8(%ebp) | |
448 4f: 68 00 00 00 00 push $0x0 | |
449 54: e8 fc ff ff ff call 55 <nonleaf_call+0x50> | |
450 59: 83 c4 10 add $0x10,%esp | |
451 5c: c9 leave | |
452 5d: c3 ret | |
453 | |
454 0000005e <main>: | |
455 5e: 55 push %ebp | |
456 5f: 89 e5 mov %esp,%ebp | |
457 61: 83 ec 18 sub $0x18,%esp | |
458 64: 83 e4 f0 and $0xfffffff0,%esp | |
459 67: b8 00 00 00 00 mov $0x0,%eax | |
460 6c: 29 c4 sub %eax,%esp | |
461 6e: a1 00 00 00 00 mov 0x0,%eax | |
462 73: 89 45 e8 mov %eax,0xffffffe8(%ebp) | |
463 76: 6a 07 push $0x7 | |
464 78: 6a 06 push $0x6 | |
465 7a: 6a 05 push $0x5 | |
466 7c: 6a 04 push $0x4 | |
467 7e: 6a 03 push $0x3 | |
468 80: 6a 02 push $0x2 | |
469 82: 6a 01 push $0x1 | |
470 84: 6a 00 push $0x0 | |
471 86: e8 fc ff ff ff call 87 <main+0x29> | |
472 8b: 83 c4 20 add $0x20,%esp | |
473 8e: b8 00 00 00 00 mov $0x0,%eax | |
474 93: 8b 55 e8 mov 0xffffffe8(%ebp),%edx | |
475 96: 3b 15 00 00 00 00 cmp 0x0,%edx | |
476 9c: 74 13 je b1 <main+0x53> | |
477 9e: 83 ec 08 sub $0x8,%esp | |
478 a1: ff 75 e8 pushl 0xffffffe8(%ebp) | |
479 a4: 68 0d 00 00 00 push $0xd | |
480 a9: e8 fc ff ff ff call aa <main+0x4c> | |
481 ae: 83 c4 10 add $0x10,%esp | |
482 b1: c9 leave | |
483 b2: c3 ret | |
484 | |
485 | |
486 | |
487 ; @@@ windows missing | |
488 | |
489 ; vim: ft=asm | |
490 |