blob: a7e39e1c79c849b78540e9cdf1916038e5af752f (
plain)
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
|
.data 8
ok:
.c "ok"
.code
jmpi main
name putr
putr:
prolog
frame 160
arg $ac
arg $auc
arg $as
arg $aus
arg $ai
#if __WORDSIZE == 64
arg $aui
arg $al
#endif
arg_f $af
arg_d $ad
arg $a
#if __WORDSIZE == 64
arg $_l
arg $_ui
#endif
arg $_i
arg $_us
arg $_s
arg $_uc
arg $_c
getarg_c %r0 $ac
negr %r0 %r0
putargr %r0 $ac
getarg_uc %r0 $auc
negr %r0 %r0
putargr %r0 $auc
getarg_s %r0 $as
negr %r0 %r0
putargr %r0 $as
getarg_us %r0 $aus
negr %r0 %r0
putargr %r0 $aus
getarg_i %r0 $ai
negr %r0 %r0
putargr %r0 $ai
#if __WORDSIZE == 64
getarg_ui %r0 $aui
negr %r0 %r0
putargr %r0 $aui
getarg_l %r0 $al
negr %r0 %r0
putargr %r0 $al
#endif
getarg_f %f0 $af
negr_f %f0 %f0
putargr_f %f0 $af
getarg_d %f0 $ad
negr_d %f0 %f0
putargr_d %f0 $ad
getarg %r0 $a
negr %r0 %r0
putargr %r0 $a
#if __WORDSIZE == 64
getarg_l %r0 $_l
negr %r0 %r0
putargr %r0 $_l
getarg_ui %r0 $_ui
negr %r0 %r0
putargr %r0 $_ui
#endif
getarg_i %r0 $_i
negr %r0 %r0
putargr %r0 $_i
getarg_us %r0 $_us
negr %r0 %r0
putargr %r0 $_us
getarg_s %r0 $_s
negr %r0 %r0
putargr %r0 $_s
getarg_uc %r0 $_uc
negr %r0 %r0
putargr %r0 $_uc
getarg_c %r0 $_c
negr %r0 %r0
putargr %r0 $_c
jmpi _putr
rputr:
putargi 17 $ac
putargi 16 $auc
putargi 15 $as
putargi 14 $aus
putargi 13 $ai
#if __WORDSIZE == 64
putargi 12 $aui
putargi 11 $al
#endif
putargi_f 10 $af
putargi_d 9 $ad
putargi 8 $a
#if __WORDSIZE == 64
putargi 7 $_l
putargi 6 $_ui
#endif
putargi 5 $_i
putargi 4 $_us
putargi 3 $_s
putargi 2 $_uc
putargi 1 $_c
jmpi _puti
rputi:
ret
epilog
name _putr
_putr:
prolog
tramp 160
arg $ac
arg $auc
arg $as
arg $aus
arg $ai
#if __WORDSIZE == 64
arg $aui
arg $al
#endif
arg_f $af
arg_d $ad
arg $a
#if __WORDSIZE == 64
arg $_l
arg $_ui
#endif
arg $_i
arg $_us
arg $_s
arg $_uc
arg $_c
getarg_c %r0 $ac
beqi rac %r0 -1
calli @abort
rac:
getarg_uc %r0 $auc
beqi rauc %r0 $(-2 & 0xff)
calli @abort
rauc:
getarg_s %r0 $as
beqi ras %r0 -3
calli @abort
ras:
getarg_us %r0 $aus
beqi raus %r0 $(-4 & 0xffff)
calli @abort
raus:
getarg_i %r0 $ai
beqi rai %r0 -5
calli @abort
rai:
#if __WORDSIZE == 64
getarg_ui %r0 $aui
beqi raui %r0 $(-6 & 0xffffffff)
calli @abort
raui:
getarg_l %r0 $al
beqi ral %r0 -7
calli @abort
ral:
#endif
getarg_f %f0 $af
beqi_f raf %f0 -8
calli @abort
raf:
getarg_d %f0 $ad
beqi_d rad %f0 -9
calli @abort
rad:
getarg %r0 $a
beqi ra %r0 -10
calli @abort
ra:
#if __WORDSIZE == 64
getarg %r0 $_l
beqi r_l %r0 -11
calli @abort
r_l:
getarg_ui %r0 $_ui
beqi r_ui %r0 $(-12 & 0xffffffff)
calli @abort
r_ui:
#endif
getarg_i %r0 $_i
beqi r_i %r0 -13
calli @abort
r_i:
getarg_us %r0 $_us
beqi r_us %r0 $(-14 & 0xffff)
calli @abort
r_us:
getarg_s %r0 $_s
beqi r_s %r0 -15
calli @abort
r_s:
getarg_uc %r0 $_uc
beqi r_uc %r0 $(-16 & 0xff)
calli @abort
r_uc:
getarg_c %r0 $_c
beqi r_c %r0 -17
calli @abort
r_c:
jmpi rputr
epilog
name _puti
_puti:
prolog
tramp 160
arg $ac
arg $auc
arg $as
arg $aus
arg $ai
#if __WORDSIZE == 64
arg $aui
arg $al
#endif
arg_f $af
arg_d $ad
arg $a
#if __WORDSIZE == 64
arg $_l
arg $_ui
#endif
arg $_i
arg $_us
arg $_s
arg $_uc
arg $_c
getarg_c %r0 $ac
beqi iac %r0 17
calli @abort
iac:
getarg_uc %r0 $auc
beqi iauc %r0 16
calli @abort
iauc:
getarg_s %r0 $as
beqi ias %r0 15
calli @abort
ias:
getarg_us %r0 $aus
beqi iaus %r0 14
calli @abort
iaus:
getarg_i %r0 $ai
beqi iai %r0 13
calli @abort
iai:
#if __WORDSIZE == 64
getarg_ui %r0 $aui
beqi iaui %r0 12
calli @abort
iaui:
getarg_l %r0 $al
beqi ial %r0 11
calli @abort
ial:
#endif
getarg_f %f0 $af
beqi_f iaf %f0 10
calli @abort
iaf:
getarg_d %f0 $ad
beqi_d iad %f0 9
calli @abort
iad:
getarg %r0 $a
beqi ia %r0 8
calli @abort
ia:
#if __WORDSIZE == 64
getarg %r0 $_l
beqi i_l %r0 7
calli @abort
i_l:
getarg_ui %r0 $_ui
beqi i_ui %r0 6
calli @abort
i_ui:
#endif
getarg_i %r0 $_i
beqi i_i %r0 5
calli @abort
i_i:
getarg_us %r0 $_us
beqi i_us %r0 4
calli @abort
i_us:
getarg_s %r0 $_s
beqi i_s %r0 3
calli @abort
i_s:
getarg_uc %r0 $_uc
beqi i_uc %r0 2
calli @abort
i_uc:
getarg_c %r0 $_c
beqi i_c %r0 1
calli @abort
i_c:
jmpi rputi
epilog
name putf
putf:
prolog
frame 56
arg $i1
arg_d $d1
arg_f $f1
arg_f $f2
arg_f $f3
arg $i2
arg_d $d2
getarg %r0 $i1
addi %r0 %r0 1
putargr %r0 $i1
getarg_d %f0 $d1
addi_d %f0 %f0 1
putargr_d %f0 $d1
getarg_f %f0 $f1
addi_f %f0 %f0 1
putargr_f %f0 $f1
getarg_f %f0 $f2
subi_f %f0 %f0 1
putargr_f %f0 $f2
putargi_f -5 $f3
putargi -6 $i2
putargi_d -7 $d2
jmpi _putf
rputf:
ret
epilog
name _putf
_putf:
prolog
tramp 56
arg $i1
arg_d $d1
arg_f $f1
arg_f $f2
arg_f $f3
arg $i2
arg_d $d2
getarg %r0 $i1
beqi fi1 %r0 2
calli @abort
fi1:
getarg_d %f0 $d1
beqi_d fd1 %f0 3
calli @abort
fd1:
getarg_f %f0 $f1
beqi_f ff1 %f0 4
calli @abort
ff1:
getarg_f %f0 $f2
beqi_f ff2 %f0 3
calli @abort
ff2:
getarg_f %f0 $f3
beqi_f ff3 %f0 -5
calli @abort
ff3:
getarg %r0 $i2
beqi fi2 %r0 -6
calli @abort
fi2:
getarg_d %f0 $d2
beqi_d fd2 %f0 -7
calli @abort
fd2:
jmpi rputf
epilog
name main
main:
prolog
prepare
pushargi 1
pushargi 2
pushargi 3
pushargi 4
pushargi 5
#if __WORDSIZE == 64
pushargi 6
pushargi 7
#endif
pushargi_f 8
pushargi_d 9
pushargi 10
#if __WORDSIZE == 64
pushargi 11
pushargi 12
#endif
pushargi 13
pushargi 14
pushargi 15
pushargi 16
pushargi 17
finishi putr
prepare
pushargi 1
pushargi_d 2
pushargi_f 3
pushargi_f 4
pushargi_f 5
pushargi 6
pushargi_d 7
finishi putf
prepare
pushargi ok
finishi @puts
ret
epilog
|