Mercurial > pub > dyncall > dyncall
comparison doc/disas_examples/sparc.sparc.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 | c73c59c8b553 |
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 debian-4.0_r3-sparc w/ gcc 4.1.2 | |
23 | |
24 00000000 <leaf_call>: | |
25 0: 9d e3 bf 98 save %sp, -104, %sp | |
26 4: f0 27 a0 44 st %i0, [ %fp + 0x44 ] | |
27 8: f2 27 a0 48 st %i1, [ %fp + 0x48 ] | |
28 c: f4 27 a0 4c st %i2, [ %fp + 0x4c ] | |
29 10: f6 27 a0 50 st %i3, [ %fp + 0x50 ] | |
30 14: f8 27 a0 54 st %i4, [ %fp + 0x54 ] | |
31 18: fa 27 a0 58 st %i5, [ %fp + 0x58 ] | |
32 1c: 81 e8 00 00 restore | |
33 20: 81 c3 e0 08 retl | |
34 24: 01 00 00 00 nop | |
35 | |
36 00000028 <nonleaf_call>: | |
37 28: 9d e3 bf 88 save %sp, -120, %sp ; prolog | |
38 2c: f0 27 a0 44 st %i0, [ %fp + 0x44 ] ; | | |
39 30: f2 27 a0 48 st %i1, [ %fp + 0x48 ] ; | | |
40 34: f4 27 a0 4c st %i2, [ %fp + 0x4c ] ; | write input to prev frame's spill area | |
41 38: f6 27 a0 50 st %i3, [ %fp + 0x50 ] ; | (e.g. offset = 68 for i0, jumping over i*/l* save area and aggregate return pointer) | |
42 3c: f8 27 a0 54 st %i4, [ %fp + 0x54 ] ; | | |
43 40: fa 27 a0 58 st %i5, [ %fp + 0x58 ] ; | | |
44 44: 9c 03 bf 20 add %sp, -224, %sp ; alloca(220) - with 4b padding (multiple of 8), and ... | |
45 48: 82 03 a0 64 add %sp, 0x64, %g1 ; ... at least 100b at top of stack, via ... | |
46 4c: c2 27 bf f4 st %g1, [ %fp + -12 ] ; ... local space (pointlessly) ... | |
47 50: c4 07 bf f4 ld [ %fp + -12 ], %g2 ; ... to g2 | |
48 54: 82 00 a0 07 add %g2, 7, %g1 ; | | |
49 58: 83 30 60 03 srl %g1, 3, %g1 ; | 8b alignment of alloca()'d space pointed to by g1 | |
50 5c: 83 28 60 03 sll %g1, 3, %g1 ; | | |
51 60: c2 27 bf f4 st %g1, [ %fp + -12 ] ; free g1 again by copy via temp space, ... | |
52 64: c4 07 bf f4 ld [ %fp + -12 ], %g2 ; ... to g2 | |
53 68: 82 10 20 4c mov 0x4c, %g1 ; 'L' -> g1, and ... | |
54 6c: c2 28 80 00 stb %g1, [ %g2 ] ; ... store in aligned alloca()'d space | |
55 70: c2 07 a0 60 ld [ %fp + 0x60 ], %g1 ; arg 6 (fetched from prev frame's stack param area), and ... | |
56 74: c2 23 a0 5c st %g1, [ %sp + 0x5c ] ; ... "pushed" onto stack | |
57 78: d0 07 a0 48 ld [ %fp + 0x48 ], %o0 ; | | |
58 7c: d2 07 a0 4c ld [ %fp + 0x4c ], %o1 ; | | |
59 80: d4 07 a0 50 ld [ %fp + 0x50 ], %o2 ; | | |
60 84: d6 07 a0 54 ld [ %fp + 0x54 ], %o3 ; | arg 0,1,2,3,4 (fetched from prev frame's spill area) | |
61 88: d8 07 a0 58 ld [ %fp + 0x58 ], %o4 ; | | |
62 8c: da 07 a0 5c ld [ %fp + 0x5c ], %o5 ; arg 5 (fetched from prev frame's stack param area) | |
63 90: 40 00 00 00 call 90 <nonleaf_call+0x68> ; call leaf_call (objdump not from final link but .o) | |
64 94: 01 00 00 00 nop ; branch delay slot | |
65 98: 81 e8 00 00 restore ; | | |
66 9c: 81 c3 e0 08 retl ; | epilog | |
67 a0: 01 00 00 00 nop ; | branch delay slot | |
68 | |
69 000000a4 <main>: | |
70 a4: 9d e3 bf 90 save %sp, -112, %sp ; prolog | |
71 a8: 82 10 20 06 mov 6, %g1 ; arg 6, ... | |
72 ac: c2 23 a0 5c st %g1, [ %sp + 0x5c ] ; ... "pushed" onto stack | |
73 b0: 82 10 20 07 mov 7, %g1 ; arg 7, ... | |
74 b4: c2 23 a0 60 st %g1, [ %sp + 0x60 ] ; ... "pushed" onto stack | |
75 b8: 90 10 20 00 clr %o0 ; arg 0 | |
76 bc: 92 10 20 01 mov 1, %o1 ; arg 1 | |
77 c0: 94 10 20 02 mov 2, %o2 ; arg 2 | |
78 c4: 96 10 20 03 mov 3, %o3 ; arg 3 | |
79 c8: 98 10 20 04 mov 4, %o4 ; arg 4 | |
80 cc: 9a 10 20 05 mov 5, %o5 ; arg 5 | |
81 d0: 40 00 00 00 call d0 <main+0x2c> ; call nonleaf_call (objdump not from final link but .o) | |
82 d4: 01 00 00 00 nop ; branch delay slot | |
83 d8: 82 10 20 00 clr %g1 ! 0 <leaf_call> ; | | |
84 dc: b0 10 00 01 mov %g1, %i0 ; / return value | |
85 e0: 81 e8 00 00 restore ; \ | |
86 e4: 81 c3 e0 08 retl ; | epilog | |
87 e8: 01 00 00 00 nop ; | branch delay slot | |
88 | |
89 | |
90 | |
91 ; output from netbsd-6.0-sparc w/ gcc 4.5.3 | |
92 | |
93 00000000 <leaf_call>: | |
94 0: 9d e3 bf a0 save %sp, -96, %sp | |
95 4: f0 27 a0 44 st %i0, [ %fp + 0x44 ] | |
96 8: f2 27 a0 48 st %i1, [ %fp + 0x48 ] | |
97 c: f4 27 a0 4c st %i2, [ %fp + 0x4c ] | |
98 10: f6 27 a0 50 st %i3, [ %fp + 0x50 ] | |
99 14: f8 27 a0 54 st %i4, [ %fp + 0x54 ] | |
100 18: fa 27 a0 58 st %i5, [ %fp + 0x58 ] | |
101 1c: 81 e8 00 00 restore | |
102 20: 81 c3 e0 08 retl | |
103 24: 01 00 00 00 nop | |
104 | |
105 00000028 <nonleaf_call>: | |
106 28: 9d e3 bf 98 save %sp, -104, %sp | |
107 2c: f0 27 a0 44 st %i0, [ %fp + 0x44 ] | |
108 30: f2 27 a0 48 st %i1, [ %fp + 0x48 ] | |
109 34: f4 27 a0 4c st %i2, [ %fp + 0x4c ] | |
110 38: f6 27 a0 50 st %i3, [ %fp + 0x50 ] | |
111 3c: f8 27 a0 54 st %i4, [ %fp + 0x54 ] | |
112 40: fa 27 a0 58 st %i5, [ %fp + 0x58 ] | |
113 44: 9c 03 bf 20 add %sp, -224, %sp | |
114 48: 82 03 a0 64 add %sp, 0x64, %g1 | |
115 4c: 82 00 60 07 add %g1, 7, %g1 | |
116 50: 83 30 60 03 srl %g1, 3, %g1 | |
117 54: 83 28 60 03 sll %g1, 3, %g1 | |
118 58: 84 10 20 4c mov 0x4c, %g2 | |
119 5c: c4 28 40 00 stb %g2, [ %g1 ] | |
120 60: c2 07 a0 60 ld [ %fp + 0x60 ], %g1 | |
121 64: c2 23 a0 5c st %g1, [ %sp + 0x5c ] | |
122 68: d0 07 a0 48 ld [ %fp + 0x48 ], %o0 | |
123 6c: d2 07 a0 4c ld [ %fp + 0x4c ], %o1 | |
124 70: d4 07 a0 50 ld [ %fp + 0x50 ], %o2 | |
125 74: d6 07 a0 54 ld [ %fp + 0x54 ], %o3 | |
126 78: d8 07 a0 58 ld [ %fp + 0x58 ], %o4 | |
127 7c: da 07 a0 5c ld [ %fp + 0x5c ], %o5 | |
128 80: 40 00 00 00 call 80 <nonleaf_call+0x58> | |
129 84: 01 00 00 00 nop | |
130 88: 81 e8 00 00 restore | |
131 8c: 81 c3 e0 08 retl | |
132 90: 01 00 00 00 nop | |
133 | |
134 00000094 <main>: | |
135 94: 9d e3 bf 98 save %sp, -104, %sp | |
136 98: 82 10 20 06 mov 6, %g1 | |
137 9c: c2 23 a0 5c st %g1, [ %sp + 0x5c ] | |
138 a0: 82 10 20 07 mov 7, %g1 | |
139 a4: c2 23 a0 60 st %g1, [ %sp + 0x60 ] | |
140 a8: 90 10 20 00 clr %o0 | |
141 ac: 92 10 20 01 mov 1, %o1 | |
142 b0: 94 10 20 02 mov 2, %o2 | |
143 b4: 96 10 20 03 mov 3, %o3 | |
144 b8: 98 10 20 04 mov 4, %o4 | |
145 bc: 9a 10 20 05 mov 5, %o5 | |
146 c0: 40 00 00 00 call c0 <main+0x2c> | |
147 c4: 01 00 00 00 nop | |
148 c8: 82 10 20 00 clr %g1 ! 0 <leaf_call> | |
149 cc: b0 10 00 01 mov %g1, %i0 | |
150 d0: 81 e8 00 00 restore | |
151 d4: 81 c3 e0 08 retl | |
152 d8: 01 00 00 00 nop | |
153 | |
154 | |
155 | |
156 ; output from openbsd-5.8-sparc w/ gcc 4.2.1 | |
157 | |
158 00000000 <leaf_call>: | |
159 0: 9d e3 bf 90 save %sp, -112, %sp | |
160 4: f0 27 a0 44 st %i0, [ %fp + 0x44 ] | |
161 8: f2 27 a0 48 st %i1, [ %fp + 0x48 ] | |
162 c: f4 27 a0 4c st %i2, [ %fp + 0x4c ] | |
163 10: f6 27 a0 50 st %i3, [ %fp + 0x50 ] | |
164 14: f8 27 a0 54 st %i4, [ %fp + 0x54 ] | |
165 18: fa 27 a0 58 st %i5, [ %fp + 0x58 ] | |
166 1c: 81 e8 00 00 restore | |
167 20: 81 c3 e0 08 retl | |
168 24: 01 00 00 00 nop | |
169 28: ae 03 c0 17 add %o7, %l7, %l7 | |
170 2c: 81 c3 e0 08 retl | |
171 30: 01 00 00 00 nop | |
172 | |
173 00000034 <nonleaf_call>: | |
174 34: 9d e3 bf 80 save %sp, -128, %sp | |
175 38: 2f 00 00 00 sethi %hi(0), %l7 | |
176 3c: ae 05 e0 00 add %l7, 0, %l7 ! 0 <leaf_call> | |
177 40: 7f ff ff fa call 28 <leaf_call+0x28> | |
178 44: 01 00 00 00 nop | |
179 48: f0 27 a0 44 st %i0, [ %fp + 0x44 ] | |
180 4c: f2 27 a0 48 st %i1, [ %fp + 0x48 ] | |
181 50: f4 27 a0 4c st %i2, [ %fp + 0x4c ] | |
182 54: f6 27 a0 50 st %i3, [ %fp + 0x50 ] | |
183 58: f8 27 a0 54 st %i4, [ %fp + 0x54 ] | |
184 5c: fa 27 a0 58 st %i5, [ %fp + 0x58 ] | |
185 60: 03 00 00 00 sethi %hi(0), %g1 | |
186 64: 82 10 60 00 mov %g1, %g1 ! 0 <leaf_call> | |
187 68: c2 05 c0 01 ld [ %l7 + %g1 ], %g1 | |
188 6c: c4 00 40 00 ld [ %g1 ], %g2 | |
189 70: c4 27 bf f4 st %g2, [ %fp + -12 ] | |
190 74: 84 10 20 00 clr %g2 | |
191 78: 9c 03 bf 20 add %sp, -224, %sp | |
192 7c: 86 03 a0 64 add %sp, 0x64, %g3 | |
193 80: c6 27 bf ec st %g3, [ %fp + -20 ] | |
194 84: c4 07 bf ec ld [ %fp + -20 ], %g2 | |
195 88: 82 00 a0 07 add %g2, 7, %g1 | |
196 8c: 83 30 60 03 srl %g1, 3, %g1 | |
197 90: 83 28 60 03 sll %g1, 3, %g1 | |
198 94: c2 27 bf ec st %g1, [ %fp + -20 ] | |
199 98: c4 07 bf ec ld [ %fp + -20 ], %g2 | |
200 9c: 82 10 20 4c mov 0x4c, %g1 | |
201 a0: c2 28 80 00 stb %g1, [ %g2 ] | |
202 a4: c2 07 a0 60 ld [ %fp + 0x60 ], %g1 | |
203 a8: c2 23 a0 5c st %g1, [ %sp + 0x5c ] | |
204 ac: d0 07 a0 48 ld [ %fp + 0x48 ], %o0 | |
205 b0: d2 07 a0 4c ld [ %fp + 0x4c ], %o1 | |
206 b4: d4 07 a0 50 ld [ %fp + 0x50 ], %o2 | |
207 b8: d6 07 a0 54 ld [ %fp + 0x54 ], %o3 | |
208 bc: d8 07 a0 58 ld [ %fp + 0x58 ], %o4 | |
209 c0: da 07 a0 5c ld [ %fp + 0x5c ], %o5 | |
210 c4: 40 00 00 00 call c4 <nonleaf_call+0x90> | |
211 c8: 01 00 00 00 nop | |
212 cc: 03 00 00 00 sethi %hi(0), %g1 | |
213 d0: 82 10 60 00 mov %g1, %g1 ! 0 <leaf_call> | |
214 d4: c2 05 c0 01 ld [ %l7 + %g1 ], %g1 | |
215 d8: c6 07 bf f4 ld [ %fp + -12 ], %g3 | |
216 dc: c4 00 40 00 ld [ %g1 ], %g2 | |
217 e0: 86 98 c0 02 xorcc %g3, %g2, %g3 | |
218 e4: 84 10 20 00 clr %g2 | |
219 e8: 02 80 00 08 be 108 <nonleaf_call+0xd4> | |
220 ec: 01 00 00 00 nop | |
221 f0: 03 00 00 00 sethi %hi(0), %g1 | |
222 f4: 82 10 60 00 mov %g1, %g1 ! 0 <leaf_call> | |
223 f8: c2 05 c0 01 ld [ %l7 + %g1 ], %g1 | |
224 fc: 90 10 00 01 mov %g1, %o0 | |
225 100: 40 00 00 00 call 100 <nonleaf_call+0xcc> | |
226 104: 01 00 00 00 nop | |
227 108: 81 e8 00 00 restore | |
228 10c: 81 c3 e0 08 retl | |
229 110: 01 00 00 00 nop | |
230 | |
231 00000114 <main>: | |
232 114: 9d e3 bf 88 save %sp, -120, %sp | |
233 118: 82 10 20 06 mov 6, %g1 | |
234 11c: c2 23 a0 5c st %g1, [ %sp + 0x5c ] | |
235 120: 82 10 20 07 mov 7, %g1 | |
236 124: c2 23 a0 60 st %g1, [ %sp + 0x60 ] | |
237 128: 90 10 20 00 clr %o0 | |
238 12c: 92 10 20 01 mov 1, %o1 | |
239 130: 94 10 20 02 mov 2, %o2 | |
240 134: 96 10 20 03 mov 3, %o3 | |
241 138: 98 10 20 04 mov 4, %o4 | |
242 13c: 9a 10 20 05 mov 5, %o5 | |
243 140: 40 00 00 00 call 140 <main+0x2c> | |
244 144: 01 00 00 00 nop | |
245 148: 82 10 20 00 clr %g1 ! 0 <leaf_call> | |
246 14c: b0 10 00 01 mov %g1, %i0 | |
247 150: 81 e8 00 00 restore | |
248 154: 81 c3 e0 08 retl | |
249 158: 01 00 00 00 nop | |
250 | |
251 | |
252 | |
253 ; --------------------- with float params and aggregate return value -------------------> | |
254 | |
255 ; #include <stdlib.h> | |
256 ; | |
257 ; void leaf_call(int b, float c, int d, float e, int f, int g, int h) | |
258 ; { | |
259 ; } | |
260 ; | |
261 ; struct aggr { int x; int y; int z; }; | |
262 ; | |
263 ; struct aggr nonleaf_call(int a, int b, float c, int d, float e, int f, int g, int h) | |
264 ; { | |
265 ; struct aggr st = { b, d, f }; | |
266 ; /* use some local data */ | |
267 ; *(char*)alloca(220) = 'L'; | |
268 ; leaf_call(b, c, d, e, f, g, h); | |
269 ; | |
270 ; return st; | |
271 ; } | |
272 ; | |
273 ; int main() | |
274 ; { | |
275 ; struct aggr st = nonleaf_call(0, 1, 2.f, 3, 4.f, 5, 6, 7); | |
276 ; return 0; | |
277 ; } | |
278 | |
279 | |
280 | |
281 ; output from debian-4.0_r3-sparc w/ gcc 4.1.2 | |
282 | |
283 00000000 <leaf_call>: | |
284 0: 9d e3 bf 98 save %sp, -104, %sp | |
285 4: f0 27 a0 44 st %i0, [ %fp + 0x44 ] | |
286 8: f2 27 a0 48 st %i1, [ %fp + 0x48 ] | |
287 c: f4 27 a0 4c st %i2, [ %fp + 0x4c ] | |
288 10: f6 27 a0 50 st %i3, [ %fp + 0x50 ] | |
289 14: f8 27 a0 54 st %i4, [ %fp + 0x54 ] | |
290 18: fa 27 a0 58 st %i5, [ %fp + 0x58 ] | |
291 1c: 81 e8 00 00 restore | |
292 20: 81 c3 e0 08 retl | |
293 24: 01 00 00 00 nop | |
294 | |
295 00000028 <nonleaf_call>: | |
296 28: 9d e3 bf 78 save %sp, -136, %sp ; prolog | |
297 2c: e0 07 a0 40 ld [ %fp + 0x40 ], %l0 ; pointer to struct to return -> l0 | |
298 30: f0 27 a0 44 st %i0, [ %fp + 0x44 ] ; | | |
299 34: f2 27 a0 48 st %i1, [ %fp + 0x48 ] ; | | |
300 38: f4 27 a0 4c st %i2, [ %fp + 0x4c ] ; | | |
301 3c: f6 27 a0 50 st %i3, [ %fp + 0x50 ] ; | write input to prev frame's spill area | |
302 40: f8 27 a0 54 st %i4, [ %fp + 0x54 ] ; | | |
303 44: fa 27 a0 58 st %i5, [ %fp + 0x58 ] ; / | |
304 48: c2 07 a0 48 ld [ %fp + 0x48 ], %g1 ; \ | |
305 4c: c2 27 bf ec st %g1, [ %fp + -20 ] ; | | |
306 50: c2 07 a0 50 ld [ %fp + 0x50 ], %g1 ; | in arg 1,3,5 (the ints to be returned in struct), ... | |
307 54: c2 27 bf f0 st %g1, [ %fp + -16 ] ; | ... copied to temp space in local area for later use | |
308 58: c2 07 a0 58 ld [ %fp + 0x58 ], %g1 ; | | |
309 5c: c2 27 bf f4 st %g1, [ %fp + -12 ] ; | | |
310 60: 9c 03 bf 20 add %sp, -224, %sp ; alloca(220) - with 4b padding (multiple of 8), and ... | |
311 64: 82 03 a0 64 add %sp, 0x64, %g1 ; ... at least 100b at top of stack, via ... | |
312 68: c2 27 bf e4 st %g1, [ %fp + -28 ] ; ... local space (pointlessly) ... | |
313 6c: c4 07 bf e4 ld [ %fp + -28 ], %g2 ; ... to g2 | |
314 70: 82 00 a0 07 add %g2, 7, %g1 ; | | |
315 74: 83 30 60 03 srl %g1, 3, %g1 ; | 8b alignment of alloca()'d space pointed to by g1 | |
316 78: 83 28 60 03 sll %g1, 3, %g1 ; | | |
317 7c: c2 27 bf e4 st %g1, [ %fp + -28 ] ; free g1 again by copy via temp space, ... | |
318 80: c4 07 bf e4 ld [ %fp + -28 ], %g2 ; ... to g2 | |
319 84: 82 10 20 4c mov 0x4c, %g1 ; 'L' -> g1, and ... | |
320 88: c2 28 80 00 stb %g1, [ %g2 ] ; ... store in aligned alloca()'d space | |
321 8c: c2 07 a0 60 ld [ %fp + 0x60 ], %g1 ; arg 6 (fetched from prev frame's stack param area), and ... | |
322 90: c2 23 a0 5c st %g1, [ %sp + 0x5c ] ; ... "pushed" onto stack | |
323 94: d0 07 a0 48 ld [ %fp + 0x48 ], %o0 ; | | |
324 98: d2 07 a0 4c ld [ %fp + 0x4c ], %o1 ; | | |
325 9c: d4 07 a0 50 ld [ %fp + 0x50 ], %o2 ; | arg 0,1,2,3,4 (fetched from prev frame's spill area) | |
326 a0: d6 07 a0 54 ld [ %fp + 0x54 ], %o3 ; | | |
327 a4: d8 07 a0 58 ld [ %fp + 0x58 ], %o4 ; | | |
328 a8: da 07 a0 5c ld [ %fp + 0x5c ], %o5 ; arg 5 (fetched from prev frame's stack param area) | |
329 ac: 40 00 00 00 call ac <nonleaf_call+0x84> ; call leaf_call (objdump not from final link but .o) | |
330 b0: 01 00 00 00 nop ; branch delay slot | |
331 b4: c2 07 bf ec ld [ %fp + -20 ], %g1 ; | | |
332 b8: c2 24 00 00 st %g1, [ %l0 ] ; | | |
333 bc: c2 07 bf f0 ld [ %fp + -16 ], %g1 ; | | |
334 c0: c2 24 20 04 st %g1, [ %l0 + 4 ] ; | store struct elements | |
335 c4: c2 07 bf f4 ld [ %fp + -12 ], %g1 ; | | |
336 c8: c2 24 20 08 st %g1, [ %l0 + 8 ] ; | | |
337 cc: b0 10 00 10 mov %l0, %i0 ; return value (pointer to struct) | |
338 d0: 81 e8 00 00 restore ; | | |
339 d4: 81 c3 e0 0c jmp %o7 + 0xc ; | epilog | |
340 d8: 01 00 00 00 nop ; | branch delay slot | |
341 | |
342 000000dc <main>: | |
343 dc: 9d e3 bf 80 save %sp, -128, %sp ; prolog | |
344 e0: 03 00 00 00 sethi %hi(0), %g1 ; | | |
345 e4: 82 10 60 00 mov %g1, %g1 ! 0 <leaf_call> ; | prep arg 2, load from static data into f8 (addr = 0 b/c objdumped .o, not final linked) | |
346 e8: d1 00 40 00 ld [ %g1 ], %f8 ; / | |
347 ec: 03 00 00 00 sethi %hi(0), %g1 ; \ | |
348 f0: 82 10 60 00 mov %g1, %g1 ! 0 <leaf_call> ; | prep arg 4, load from static data into f9 (addr = 0 b/c objdumped .o, not final linked) | |
349 f4: d3 00 40 00 ld [ %g1 ], %f9 ; | | |
350 f8: 82 10 20 06 mov 6, %g1 ; arg 6, ... | |
351 fc: c2 23 a0 5c st %g1, [ %sp + 0x5c ] ; ... "pushed" onto stack | |
352 100: 82 10 20 07 mov 7, %g1 ; arg 7, ... | |
353 104: c2 23 a0 60 st %g1, [ %sp + 0x60 ] ; ... "pushed" onto stack | |
354 108: 82 07 bf ec add %fp, -20, %g1 ; store pointer to some frame local data between ... | |
355 10c: c2 23 a0 40 st %g1, [ %sp + 0x40 ] ; ... spill and i*/l* save area to be used for struct return value | |
356 110: 90 10 20 00 clr %o0 ; arg 0 | |
357 114: 92 10 20 01 mov 1, %o1 ; arg 1 | |
358 118: d1 27 bf f8 st %f8, [ %fp + -8 ] ; | arg 2, from f8 via temp space ... | |
359 11c: d4 07 bf f8 ld [ %fp + -8 ], %o2 ; | ... to o2 | |
360 120: 96 10 20 03 mov 3, %o3 ; arg 3 | |
361 124: d3 27 bf f8 st %f9, [ %fp + -8 ] ; | arg 4, from f9 via temp space ... | |
362 128: d8 07 bf f8 ld [ %fp + -8 ], %o4 ; | ... to o4 | |
363 12c: 9a 10 20 05 mov 5, %o5 ; arg 5 | |
364 130: 40 00 00 00 call 130 <main+0x54> ; call nonleaf_call (objdump not from final link but .o) | |
365 134: 01 00 00 00 nop ; branch delay slot | |
366 138: 00 00 00 0c unimp 0xc ; sparc convention for returned aggregates: use unimp with field (here 0xc) specifiying size of returned struct (see sparc manual explanation) | |
367 13c: 82 10 20 00 clr %g1 ; | | |
368 140: b0 10 00 01 mov %g1, %i0 ; / return value | |
369 144: 81 e8 00 00 restore ; \ | |
370 148: 81 c3 e0 08 retl ; | epilog | |
371 14c: 01 00 00 00 nop ; | branch delay slot | |
372 | |
373 ; vim: ft=asm | |
374 |