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

Subversion Repositories eco32

[/] [eco32/] [trunk/] [lcc/] [sparc/] [solaris/] [tst/] [wf1.sbk] - Blame information for rev 52

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

Line No. Rev Author Line
1 4 hellwig
.global main
2
.section ".text"
3
.align 4
4
main:
5
save %sp,-120,%sp
6
st %g0,[%fp+-24]
7
set next,%i5
8
st %g0,[%i5]
9
ba .L3; nop
10
.L2:
11
add -20,%fp,%o0
12
add -24,%fp,%o1
13
call lookup; nop
14
ld [%o0],%i4
15
add %i4,1,%i4
16
st %i4,[%o0]
17
.L3:
18
add -20,%fp,%o0
19
call getword; nop
20
cmp %o0,0; bne .L2; nop
21
ld [%fp+-24],%o0
22
call tprint; nop
23
mov %g0,%i0
24
.L1:
25
ret; restore
26
.type main,#function
27
.size main,.-main
28
.global err
29
.align 4
30
err:
31
save %sp,-96,%sp
32
set .L6,%o0
33
mov %i0,%o1
34
call printf; nop
35
set 1,%o0
36
call exit; nop
37
mov %g0,%i0
38
.L5:
39
ret; restore
40
.type err,#function
41
.size err,.-err
42
.global getword
43
.align 4
44
getword:
45
save %sp,-96,%sp
46
.L8:
47
.L9:
48
call getchar; nop
49
mov %o0,%i3
50
mov %i3,%i5
51
cmp %i3,-1; be .L11; nop
52
mov %i5,%o0
53
call isletter; nop
54
cmp %o0,0; be .L8; nop
55
.L11:
56
mov %i0,%i4
57
ba .L15; nop
58
.L12:
59
mov %i4,%i3
60
add %i3,1,%i4
61
mov %i5,%i2
62
stb %i2,[%i3]
63
.L13:
64
call getchar; nop
65
mov %o0,%i5
66
.L15:
67
mov %i5,%o0
68
call isletter; nop
69
mov %o0,%i5
70
cmp %o0,0; bne .L12; nop
71
stb %g0,[%i4]
72
mov %i4,%i3
73
mov %i0,%i2
74
cmp %i3,%i2; bleu .L16; nop
75
set 1,%i0
76
ba .L7; nop
77
.L16:
78
mov %g0,%i0
79
.L7:
80
ret; restore
81
.type getword,#function
82
.size getword,.-getword
83
.global isletter
84
.align 4
85
isletter:
86
cmp %o0,65; bl .L19; nop
87
cmp %o0,90; bg .L19; nop
88
add %o0,32,%o0
89
.L19:
90
cmp %o0,97; bl .L21; nop
91
cmp %o0,122; bg .L21; nop
92
ba .L18; nop
93
.L21:
94
mov %g0,%o0
95
.L18:
96
retl; nop
97
.type isletter,#function
98
.size isletter,.-isletter
99
.global lookup
100
.align 4
101
lookup:
102
save %sp,-96,%sp
103
ld [%i1],%i4
104
cmp %i4,%g0; be .L24; nop
105
mov %i0,%o0
106
ld [%i1],%i4
107
ld [%i4+12],%o1
108
call strcmp; nop
109
mov %o0,%i5
110
cmp %i5,0; bge .L26; nop
111
mov %i0,%o0
112
ld [%i1],%i4
113
add %i4,4,%o1
114
call lookup; nop
115
mov %o0,%i0
116
ba .L23; nop
117
.L26:
118
cmp %i5,0; ble .L28; nop
119
mov %i0,%o0
120
ld [%i1],%i4
121
add %i4,8,%o1
122
call lookup; nop
123
mov %o0,%i0
124
ba .L23; nop
125
.L28:
126
ld [%i1],%i0
127
ba .L23; nop
128
.L24:
129
set next,%i4
130
ld [%i4],%i4
131
cmp %i4,2000; bl .L30; nop
132
set .L32,%o0
133
call err; nop
134
.L30:
135
set next,%i4
136
ld [%i4],%i4
137
sll %i4,4,%i4
138
set words,%i3
139
st %g0,[%i4+%i3]
140
set next,%i4
141
ld [%i4],%i4
142
sll %i4,4,%i4
143
set words+8,%i2
144
st %g0,[%i4+%i2]
145
set words+4,%i2
146
st %g0,[%i4+%i2]
147
mov %i0,%o0
148
call strlen; nop
149
mov %o0,%i4
150
add %i4,1,%o0
151
call malloc; nop
152
set next,%i3
153
ld [%i3],%i3
154
sll %i3,4,%i3
155
set words+12,%i2
156
st %o0,[%i3+%i2]
157
set next,%i4
158
ld [%i4],%i4
159
sll %i4,4,%i4
160
set words+12,%i3
161
ld [%i4+%i3],%i4
162
cmp %i4,%g0; bne .L36; nop
163
set .L39,%o0
164
call err; nop
165
.L36:
166
set next,%i4
167
ld [%i4],%i4
168
sll %i4,4,%i4
169
set words+12,%i3
170
ld [%i4+%i3],%o0
171
mov %i0,%o1
172
call strcpy; nop
173
set next,%i4
174
ld [%i4],%i3
175
add %i3,1,%i2
176
st %i2,[%i4]
177
sll %i3,4,%i4
178
set words,%i3
179
add %i4,%i3,%i4
180
st %i4,[%i1]
181
mov %i4,%i0
182
.L23:
183
ret; restore
184
.type lookup,#function
185
.size lookup,.-lookup
186
.global tprint
187
.align 4
188
tprint:
189
save %sp,-96,%sp
190
mov %i0,%i5
191
cmp %i5,%g0; be .L42; nop
192
ld [%i0+4],%o0
193
call tprint; nop
194
set .L44,%o0
195
ld [%i0],%o1
196
ld [%i0+12],%o2
197
call printf; nop
198
ld [%i0+8],%o0
199
call tprint; nop
200
.L42:
201
mov %g0,%i0
202
.L41:
203
ret; restore
204
.type tprint,#function
205
.size tprint,.-tprint
206
.global strcmp
207
.align 4
208
strcmp:
209
save %sp,-96,%sp
210
ba .L47; nop
211
.L46:
212
mov %i0,%i5
213
add %i5,1,%i0
214
ldsb [%i5],%i5
215
cmp %i5,0; bne .L49; nop
216
mov %g0,%i0
217
ba .L45; nop
218
.L49:
219
add %i1,1,%i1
220
.L47:
221
ldsb [%i0],%i5
222
ldsb [%i1],%i4
223
cmp %i5,%i4; be .L46; nop
224
ldsb [%i0],%i5
225
cmp %i5,0; bne .L51; nop
226
set -1,%i0
227
ba .L45; nop
228
.L51:
229
ldsb [%i1],%i5
230
cmp %i5,0; bne .L53; nop
231
set 1,%i0
232
ba .L45; nop
233
.L53:
234
ldsb [%i0],%i5
235
ldsb [%i1],%i4
236
sub %i5,%i4,%i0
237
.L45:
238
ret; restore
239
.type strcmp,#function
240
.size strcmp,.-strcmp
241
.section ".bss"
242
.global next
243
.type next,#object
244
.size next,4
245
.common next,4,4
246
.global words
247
.type words,#object
248
.size words,32000
249
.common words,32000,4
250
.section ".rodata"
251
.align 1
252
.L44:
253
.byte 37
254
.byte 100
255
.byte 9
256
.byte 37
257
.byte 115
258
.byte 10
259
.byte 0
260
.align 1
261
.L39:
262
.byte 111
263
.byte 117
264
.byte 116
265
.byte 32
266
.byte 111
267
.byte 102
268
.byte 32
269
.byte 119
270
.byte 111
271
.byte 114
272
.byte 100
273
.byte 32
274
.byte 115
275
.byte 116
276
.byte 111
277
.byte 114
278
.byte 97
279
.byte 103
280
.byte 101
281
.byte 0
282
.align 1
283
.L32:
284
.byte 111
285
.byte 117
286
.byte 116
287
.byte 32
288
.byte 111
289
.byte 102
290
.byte 32
291
.byte 110
292
.byte 111
293
.byte 100
294
.byte 101
295
.byte 32
296
.byte 115
297
.byte 116
298
.byte 111
299
.byte 114
300
.byte 97
301
.byte 103
302
.byte 101
303
.byte 0
304
.align 1
305
.L6:
306
.byte 63
307
.byte 32
308
.byte 37
309
.byte 115
310
.byte 10
311
.byte 0

powered by: WebSVN 2.1.0

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