OpenCores
URL https://opencores.org/ocsvn/eco32/eco32/trunk

Subversion Repositories eco32

[/] [eco32/] [trunk/] [lcc/] [x86/] [linux/] [tst/] [sort.sbk] - Blame information for rev 253

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 4 hellwig
.data
2
.globl in
3
.align 4
4
.type in,@object
5
in:
6
.long 10
7
.long 32
8
.long -1
9
.long 567
10
.long 3
11
.long 18
12
.long 1
13
.long -51
14
.long 789
15
.long 0
16
.size in,40
17
.globl main
18
.text
19
.align 16
20
.type main,@function
21
main:
22
pushl %ebp
23
pushl %ebx
24
pushl %esi
25
pushl %edi
26
movl %esp,%ebp
27
subl $4,%esp
28
pushl $10
29
pushl $in
30
call sort
31
addl $8,%esp
32
movl $0,-4(%ebp)
33
jmp .LC5
34
.LC2:
35
movl -4(%ebp),%edi
36
pushl in(,%edi,4)
37
call putd
38
addl $4,%esp
39
pushl $10
40
call putchar
41
addl $4,%esp
42
.LC3:
43
incl -4(%ebp)
44
.LC5:
45
movl -4(%ebp),%edi
46
cmpl $10,%edi
47
jb .LC2
48
mov $0,%eax
49
.LC1:
50
movl %ebp,%esp
51
popl %edi
52
popl %esi
53
popl %ebx
54
popl %ebp
55
ret
56
.Lf6:
57
.size main,.Lf6-main
58
.globl putd
59
.align 16
60
.type putd,@function
61
putd:
62
pushl %ebp
63
pushl %ebx
64
pushl %esi
65
pushl %edi
66
movl %esp,%ebp
67
cmpl $0,20(%ebp)
68
jge .LC8
69
pushl $45
70
call putchar
71
addl $4,%esp
72
negl 20(%ebp)
73
.LC8:
74
movl 20(%ebp),%eax
75
mov $10,%ecx
76
cdq
77
idivl %ecx
78
cmpl $0,%eax
79
je .LC10
80
movl 20(%ebp),%eax
81
mov $10,%ecx
82
cdq
83
idivl %ecx
84
pushl %eax
85
call putd
86
addl $4,%esp
87
.LC10:
88
movl 20(%ebp),%eax
89
mov $10,%ecx
90
cdq
91
idivl %ecx
92
leal 48(%edx),%edi
93
pushl %edi
94
call putchar
95
addl $4,%esp
96
mov $0,%eax
97
.LC7:
98
movl %ebp,%esp
99
popl %edi
100
popl %esi
101
popl %ebx
102
popl %ebp
103
ret
104
.Lf12:
105
.size putd,.Lf12-putd
106
.globl sort
107
.align 16
108
.type sort,@function
109
sort:
110
pushl %ebp
111
pushl %ebx
112
pushl %esi
113
pushl %edi
114
movl %esp,%ebp
115
movl 24(%ebp),%edi
116
subl $1,%edi
117
movl %edi,24(%ebp)
118
pushl %edi
119
pushl $0
120
movl 20(%ebp),%edi
121
movl %edi,xx
122
pushl %edi
123
call quick
124
addl $12,%esp
125
mov $0,%eax
126
.LC13:
127
movl %ebp,%esp
128
popl %edi
129
popl %esi
130
popl %ebx
131
popl %ebp
132
ret
133
.Lf14:
134
.size sort,.Lf14-sort
135
.globl quick
136
.align 16
137
.type quick,@function
138
quick:
139
pushl %ebp
140
pushl %ebx
141
pushl %esi
142
pushl %edi
143
movl %esp,%ebp
144
subl $4,%esp
145
movl 28(%ebp),%edi
146
cmpl %edi,24(%ebp)
147
jl .LC16
148
mov $0,%eax
149
jmp .LC15
150
.LC16:
151
pushl 28(%ebp)
152
pushl 24(%ebp)
153
pushl 20(%ebp)
154
call partition
155
addl $12,%esp
156
movl %eax,-4(%ebp)
157
movl -4(%ebp),%edi
158
subl $1,%edi
159
pushl %edi
160
pushl 24(%ebp)
161
pushl 20(%ebp)
162
call quick
163
addl $12,%esp
164
pushl 28(%ebp)
165
movl -4(%ebp),%edi
166
leal 1(%edi),%edi
167
pushl %edi
168
pushl 20(%ebp)
169
call quick
170
addl $12,%esp
171
mov $0,%eax
172
.LC15:
173
movl %ebp,%esp
174
popl %edi
175
popl %esi
176
popl %ebx
177
popl %ebp
178
ret
179
.Lf18:
180
.size quick,.Lf18-quick
181
.globl partition
182
.align 16
183
.type partition,@function
184
partition:
185
pushl %ebp
186
pushl %ebx
187
pushl %esi
188
pushl %edi
189
movl %esp,%ebp
190
subl $8,%esp
191
incl 28(%ebp)
192
movl 24(%ebp),%edi
193
movl %edi,-8(%ebp)
194
movl -8(%ebp),%edi
195
movl 20(%ebp),%esi
196
movl (%esi,%edi,4),%edi
197
movl %edi,-4(%ebp)
198
jmp .LC21
199
.LC20:
200
incl 24(%ebp)
201
jmp .LC24
202
.LC23:
203
incl 24(%ebp)
204
.LC24:
205
movl 24(%ebp),%edi
206
movl 20(%ebp),%esi
207
movl -4(%ebp),%ebx
208
cmpl %ebx,(%esi,%edi,4)
209
jl .LC23
210
decl 28(%ebp)
211
jmp .LC27
212
.LC26:
213
decl 28(%ebp)
214
.LC27:
215
movl 28(%ebp),%edi
216
movl 20(%ebp),%esi
217
movl -4(%ebp),%ebx
218
cmpl %ebx,(%esi,%edi,4)
219
jg .LC26
220
movl 28(%ebp),%edi
221
cmpl %edi,24(%ebp)
222
jge .LC29
223
movl 20(%ebp),%edi
224
movl 28(%ebp),%esi
225
leal (%edi,%esi,4),%esi
226
pushl %esi
227
movl 24(%ebp),%esi
228
leal (%edi,%esi,4),%edi
229
pushl %edi
230
call exchange
231
addl $8,%esp
232
.LC29:
233
.LC21:
234
movl 28(%ebp),%edi
235
cmpl %edi,24(%ebp)
236
jl .LC20
237
movl 20(%ebp),%edi
238
movl 28(%ebp),%esi
239
leal (%edi,%esi,4),%esi
240
pushl %esi
241
movl -8(%ebp),%esi
242
leal (%edi,%esi,4),%edi
243
pushl %edi
244
call exchange
245
addl $8,%esp
246
movl 28(%ebp),%eax
247
.LC19:
248
movl %ebp,%esp
249
popl %edi
250
popl %esi
251
popl %ebx
252
popl %ebp
253
ret
254
.Lf31:
255
.size partition,.Lf31-partition
256
.globl exchange
257
.align 16
258
.type exchange,@function
259
exchange:
260
pushl %ebp
261
pushl %ebx
262
pushl %esi
263
pushl %edi
264
movl %esp,%ebp
265
subl $4,%esp
266
movl xx,%edi
267
mov $4,%esi
268
movl 24(%ebp),%ebx
269
subl %edi,%ebx
270
movl %ebx,%eax
271
movl %esi,%ecx
272
cdq
273
idivl %ecx
274
pushl %eax
275
movl 20(%ebp),%ebx
276
subl %edi,%ebx
277
movl %ebx,%eax
278
movl %esi,%ecx
279
cdq
280
idivl %ecx
281
pushl %eax
282
pushl $.LC33
283
call printf
284
addl $12,%esp
285
movl 20(%ebp),%edi
286
movl (,%edi),%esi
287
movl %esi,-4(%ebp)
288
movl 24(%ebp),%esi
289
movl (,%esi),%esi
290
movl %esi,(,%edi)
291
movl 24(%ebp),%edi
292
movl -4(%ebp),%esi
293
movl %esi,(,%edi)
294
mov $0,%eax
295
.LC32:
296
movl %ebp,%esp
297
popl %edi
298
popl %esi
299
popl %ebx
300
popl %ebp
301
ret
302
.Lf34:
303
.size exchange,.Lf34-exchange
304
.bss
305
.globl xx
306
.align 4
307
.type xx,@object
308
.size xx,4
309
.comm xx,4
310
.data
311
.align 1
312
.LC33:
313
.byte 101
314
.byte 120
315
.byte 99
316
.byte 104
317
.byte 97
318
.byte 110
319
.byte 103
320
.byte 101
321
.byte 40
322
.byte 37
323
.byte 100
324
.byte 44
325
.byte 37
326
.byte 100
327
.byte 41
328
.byte 10
329
.byte 0
330
.text
331
.ident "LCC: 4.1"

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.