aboutsummaryrefslogtreecommitdiffstats
path: root/code/tools/lcc/x86/linux/tst/cvt.sbk
blob: fa3c1300c1bb09d5fadc49cab8a34bfaf2028c3e (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
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
.globl print
.text
.align 16
.type print,@function
print:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
fldl D
subl $8,%esp
fstpl (%esp)
fldl d
subl $8,%esp
fstpl (%esp)
flds f
subl $8,%esp
fstpl (%esp)
pushl L
pushl I
movw S,%di
movzwl %di,%edi
pushl %edi
movb C,%bl
movzbl %bl,%edi
pushl %edi
pushl l
pushl i
movswl s,%edi
pushl %edi
movsbl c,%edi
pushl %edi
pushl $.LC2
call printf
addl $60,%esp
.LC1:
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf3:
.size print,.Lf3-print
.globl main
.align 16
.type main,@function
main:
pushl %ebp
pushl %ebx
pushl %esi
pushl %edi
movl %esp,%ebp
subl $296,%esp
movb $1,c
movsbl c,%edi
movl %edi,%esi
movw %si,s
movl %edi,i
movl %edi,l
movl %edi,%esi
movl %esi,%ebx
movb %bl,C
movl %esi,%ebx
movw %bx,S
movl %esi,I
movl %esi,L
pushl %edi
fildl (%esp)
addl $4,%esp
fstps f
pushl %edi
fildl (%esp)
addl $4,%esp
fstpl -8(%ebp)
fldl -8(%ebp)
fstpl d
fldl -8(%ebp)
fstpl D
call print
movw $2,s
movswl s,%edi
movl %edi,%ebx
movb %bl,c
movl %edi,i
movl %edi,l
movl %edi,%esi
movl %esi,%ebx
movb %bl,C
movl %esi,%ebx
movw %bx,S
movl %esi,I
movl %esi,L
pushl %edi
fildl (%esp)
addl $4,%esp
fstps f
pushl %edi
fildl (%esp)
addl $4,%esp
fstpl -16(%ebp)
fldl -16(%ebp)
fstpl d
fldl -16(%ebp)
fstpl D
call print
movl $3,i
movl i,%edi
movl %edi,%ebx
movb %bl,c
movl %edi,%esi
movw %si,s
movl %edi,l
movl %edi,%esi
movl %esi,%ebx
movb %bl,C
movl %esi,%ebx
movw %bx,S
movl %esi,I
movl %esi,L
pushl %edi
fildl (%esp)
addl $4,%esp
fstps f
pushl %edi
fildl (%esp)
addl $4,%esp
fstpl -24(%ebp)
fldl -24(%ebp)
fstpl d
fldl -24(%ebp)
fstpl D
call print
movl $4,l
movl l,%edi
movl %edi,%ebx
movb %bl,c
movl %edi,%esi
movw %si,s
movl %edi,i
movl %edi,%esi
movl %esi,%ebx
movb %bl,C
movl %esi,%ebx
movw %bx,S
movl %esi,I
movl %esi,L
pushl %edi
fildl (%esp)
addl $4,%esp
fstps f
pushl %edi
fildl (%esp)
addl $4,%esp
fstpl -32(%ebp)
fldl -32(%ebp)
fstpl d
fldl -32(%ebp)
fstpl D
call print
movb $5,C
movb C,%bl
movzbl %bl,%edi
movl %edi,%ebx
movb %bl,c
movl %edi,%esi
movw %si,s
movl %edi,i
movl %edi,l
movl %edi,%esi
movl %esi,%ebx
movw %bx,S
movl %esi,I
movl %esi,L
pushl %edi
fildl (%esp)
addl $4,%esp
fstps f
pushl %edi
fildl (%esp)
addl $4,%esp
fstpl -40(%ebp)
fldl -40(%ebp)
fstpl d
fldl -40(%ebp)
fstpl D
call print
movw $6,S
movw S,%di
movzwl %di,%edi
movl %edi,%ebx
movb %bl,c
movl %edi,%esi
movw %si,s
movl %edi,i
movl %edi,l
movl %edi,%esi
movl %esi,%ebx
movb %bl,C
movl %esi,I
movl %esi,L
pushl %edi
fildl (%esp)
addl $4,%esp
fstps f
pushl %edi
fildl (%esp)
addl $4,%esp
fstpl -48(%ebp)
fldl -48(%ebp)
fstpl d
fldl -48(%ebp)
fstpl D
call print
movl $7,I
movl I,%edi
movl %edi,%ebx
movb %bl,c
movl %edi,%ebx
movw %bx,s
movl %edi,i
movl %edi,l
movl %edi,%ebx
movb %bl,C
movl %edi,%esi
movw %si,S
movl %edi,L
fldl .LC5
movl %edi,%esi
shrl $1,%esi
pushl %esi
fildl (%esp)
addl $4,%esp
fmulp %st(1),%st
andl $1,%edi
pushl %edi
fildl (%esp)
addl $4,%esp
faddp %st(1),%st
fstpl -56(%ebp)
fldl -56(%ebp)
fstps f
fldl -56(%ebp)
fstpl d
fldl -56(%ebp)
fstpl D
call print
movl $8,L
movl L,%edi
movl %edi,%ebx
movb %bl,c
movl %edi,%ebx
movw %bx,s
movl %edi,i
movl %edi,l
movl %edi,%ebx
movb %bl,C
movl %edi,%esi
movw %si,S
movw S,%si
movzwl %si,%esi
movl %esi,I
fldl .LC5
movl %edi,%esi
shrl $1,%esi
pushl %esi
fildl (%esp)
addl $4,%esp
fmulp %st(1),%st
andl $1,%edi
pushl %edi
fildl (%esp)
addl $4,%esp
faddp %st(1),%st
fstpl -64(%ebp)
fldl -64(%ebp)
fstps f
fldl -64(%ebp)
fstpl d
fldl -64(%ebp)
fstpl D
call print
flds .LC6
fstps f
flds f
fstps -84(%ebp)
flds -84(%ebp)
subl $4,%esp
fistpl 0(%esp)
popl %eax
movl %eax,%edi
movl %edi,%ebx
movb %bl,c
movl %edi,%esi
movw %si,s
movl %edi,i
movl %edi,l
flds .LC10
fcomps -84(%ebp)
fstsw %ax
sahf
ja .LC8
flds -84(%ebp)
fsubs .LC10
subl $4,%esp
fistpl 0(%esp)
popl %eax
movl %eax,%edi
leal 0x80000000(%edi),%edi
movl %edi,-68(%ebp)
jmp .LC9
.LC8:
flds -84(%ebp)
subl $4,%esp
fistpl 0(%esp)
popl %eax
movl %eax,%edi
movl %edi,-68(%ebp)
.LC9:
movl -68(%ebp),%edi
movl %edi,%ebx
movb %bl,C
flds .LC10
fcomps f
fstsw %ax
sahf
ja .LC12
flds f
fsubs .LC10
subl $4,%esp
fistpl 0(%esp)
popl %eax
movl %eax,%edi
leal 0x80000000(%edi),%edi
movl %edi,-72(%ebp)
jmp .LC13
.LC12:
flds f
subl $4,%esp
fistpl 0(%esp)
popl %eax
movl %eax,%edi
movl %edi,-72(%ebp)
.LC13:
movl -72(%ebp),%edi
movw %di,S
flds .LC10
fcomps f
fstsw %ax
sahf
ja .LC15
flds f
fsubs .LC10
subl $4,%esp
fistpl 0(%esp)
popl %eax
movl %eax,%edi
leal 0x80000000(%edi),%edi
movl %edi,-76(%ebp)
jmp .LC16
.LC15:
flds f
subl $4,%esp
fistpl 0(%esp)
popl %eax
movl %eax,%edi
movl %edi,-76(%ebp)
.LC16:
movl -76(%ebp),%edi
movl %edi,I
flds .LC10
fcomps f
fstsw %ax
sahf
ja .LC18
flds f
fsubs .LC10
subl $4,%esp
fistpl 0(%esp)
popl %eax
movl %eax,%edi
leal 0x80000000(%edi),%edi
movl %edi,-80(%ebp)
jmp .LC19
.LC18:
flds f
subl $4,%esp
fistpl 0(%esp)
popl %eax
movl %eax,%edi
movl %edi,-80(%ebp)
.LC19:
movl -80(%ebp),%edi
movl %edi,L
flds f
fstpl -120(%ebp)
fldl -120(%ebp)
fstpl d
fldl -120(%ebp)
fstpl D
call print
fldl .LC20
fstpl d
fldl d
fstpl -144(%ebp)
fldl -144(%ebp)
subl $4,%esp
fistpl 0(%esp)
popl %eax
movl %eax,%edi
movl %edi,%ebx
movb %bl,c
movl %edi,%esi
movw %si,s
movl %edi,i
movl %edi,l
fldl .LC24
fcompl -144(%ebp)
fstsw %ax
sahf
ja .LC22
fldl -144(%ebp)
fsubl .LC24
subl $4,%esp
fistpl 0(%esp)
popl %eax
movl %eax,%edi
leal 0x80000000(%edi),%edi
movl %edi,-124(%ebp)
jmp .LC23
.LC22:
fldl -144(%ebp)
subl $4,%esp
fistpl 0(%esp)
popl %eax
movl %eax,%edi
movl %edi,-124(%ebp)
.LC23:
movl -124(%ebp),%edi
movl %edi,%ebx
movb %bl,C
fldl .LC24
fcompl d
fstsw %ax
sahf
ja .LC26
fldl d
fsubl .LC24
subl $4,%esp
fistpl 0(%esp)
popl %eax
movl %eax,%edi
leal 0x80000000(%edi),%edi
movl %edi,-128(%ebp)
jmp .LC27
.LC26:
fldl d
subl $4,%esp
fistpl 0(%esp)
popl %eax
movl %eax,%edi
movl %edi,-128(%ebp)
.LC27:
movl -128(%ebp),%edi
movw %di,S
fldl .LC24
fcompl d
fstsw %ax
sahf
ja .LC29
fldl d
fsubl .LC24
subl $4,%esp
fistpl 0(%esp)
popl %eax
movl %eax,%edi
leal 0x80000000(%edi),%edi
movl %edi,-132(%ebp)
jmp .LC30
.LC29:
fldl d
subl $4,%esp
fistpl 0(%esp)
popl %eax
movl %eax,%edi
movl %edi,-132(%ebp)
.LC30:
movl -132(%ebp),%edi
movl %edi,I
fldl .LC24
fcompl d
fstsw %ax
sahf
ja .LC32
fldl d
fsubl .LC24
subl $4,%esp
fistpl 0(%esp)
popl %eax
movl %eax,%edi
leal 0x80000000(%edi),%edi
movl %edi,-136(%ebp)
jmp .LC33
.LC32:
fldl d
subl $4,%esp
fistpl 0(%esp)
popl %eax
movl %eax,%edi
movl %edi,-136(%ebp)
.LC33:
movl -136(%ebp),%edi
movl %edi,L
fldl d
fstps f
fldl d
fstpl D
call print
fldl .LC34
fstpl D
fldl D
fstpl -232(%ebp)
fldl -232(%ebp)
subl $4,%esp
fistpl 0(%esp)
popl %eax
movl %eax,%edi
movl %edi,%ebx
movb %bl,c
movl %edi,%esi
movw %si,s
movl %edi,i
movl %edi,l
fldl .LC38
fcompl -232(%ebp)
fstsw %ax
sahf
ja .LC36
fldl -232(%ebp)
fsubl .LC38
subl $4,%esp
fistpl 0(%esp)
popl %eax
movl %eax,%edi
leal 0x80000000(%edi),%edi
movl %edi,-212(%ebp)
jmp .LC37
.LC36:
fldl -232(%ebp)
subl $4,%esp
fistpl 0(%esp)
popl %eax
movl %eax,%edi
movl %edi,-212(%ebp)
.LC37:
movl -212(%ebp),%edi
movl %edi,%ebx
movb %bl,C
fldl .LC38
fcompl D
fstsw %ax
sahf
ja .LC40
fldl D
fsubl .LC38
subl $4,%esp
fistpl 0(%esp)
popl %eax
movl %eax,%edi
leal 0x80000000(%edi),%edi
movl %edi,-216(%ebp)
jmp .LC41
.LC40:
fldl D
subl $4,%esp
fistpl 0(%esp)
popl %eax
movl %eax,%edi
movl %edi,-216(%ebp)
.LC41:
movl -216(%ebp),%edi
movw %di,S
fldl .LC38
fcompl D
fstsw %ax
sahf
ja .LC43
fldl D
fsubl .LC38
subl $4,%esp
fistpl 0(%esp)
popl %eax
movl %eax,%edi
leal 0x80000000(%edi),%edi
movl %edi,-220(%ebp)
jmp .LC44
.LC43:
fldl D
subl $4,%esp
fistpl 0(%esp)
popl %eax
movl %eax,%edi
movl %edi,-220(%ebp)
.LC44:
movl -220(%ebp),%edi
movl %edi,I
fldl .LC38
fcompl D
fstsw %ax
sahf
ja .LC46
fldl D
fsubl .LC38
subl $4,%esp
fistpl 0(%esp)
popl %eax
movl %eax,%edi
leal 0x80000000(%edi),%edi
movl %edi,-224(%ebp)
jmp .LC47
.LC46:
fldl D
subl $4,%esp
fistpl 0(%esp)
popl %eax
movl %eax,%edi
movl %edi,-224(%ebp)
.LC47:
movl -224(%ebp),%edi
movl %edi,L
fldl D
fstps f
fldl D
fstpl d
call print
movl $0,p
movl $0,p
movl $0,p
movl $0,p
movl P,%edi
movl %edi,p
movl $0,P
movl $0,P
movl $0,P
movl $0,P
movl p,%edi
movl %edi,P
movl $0,%eax
.LC4:
movl %ebp,%esp
popl %edi
popl %esi
popl %ebx
popl %ebp
ret
.Lf48:
.size main,.Lf48-main
.bss
.globl P
.align 4
.type P,@object
.size P,4
.comm P,4
.globl p
.align 4
.type p,@object
.size p,4
.comm p,4
.globl D
.align 4
.type D,@object
.size D,8
.comm D,8
.globl d
.align 4
.type d,@object
.size d,8
.comm d,8
.globl f
.align 4
.type f,@object
.size f,4
.comm f,4
.globl L
.align 4
.type L,@object
.size L,4
.comm L,4
.globl I
.align 4
.type I,@object
.size I,4
.comm I,4
.globl S
.align 2
.type S,@object
.size S,2
.comm S,2
.globl C
.align 1
.type C,@object
.size C,1
.comm C,1
.globl l
.align 4
.type l,@object
.size l,4
.comm l,4
.globl i
.align 4
.type i,@object
.size i,4
.comm i,4
.globl s
.align 2
.type s,@object
.size s,2
.comm s,2
.globl c
.align 1
.type c,@object
.size c,1
.comm c,1
.data
.align 4
.LC38:
.long 0
.long 1105199104
.align 4
.LC34:
.long 0
.long 1076232192
.align 4
.LC24:
.long 0
.long 1105199104
.align 4
.LC20:
.long 0
.long 1076101120
.align 4
.LC10:
.long 1325400064
.align 4
.LC6:
.long 1091567616
.align 4
.LC5:
.long 0
.long 1073741824
.align 1
.LC2:
.byte 37
.byte 100
.byte 32
.byte 37
.byte 100
.byte 32
.byte 37
.byte 100
.byte 32
.byte 37
.byte 108
.byte 100
.byte 32
.byte 37
.byte 117
.byte 32
.byte 37
.byte 117
.byte 32
.byte 37
.byte 117
.byte 32
.byte 37
.byte 108
.byte 117
.byte 32
.byte 37
.byte 102
.byte 32
.byte 37
.byte 102
.byte 32
.byte 37
.byte 108
.byte 102
.byte 10
.byte 0
.text
.ident "LCC: 4.1"