xref: /original-bsd/old/as.tahoe/bignum.s (revision bff54947)
1.data
2.data
3_sccsid:.long	0x40282329
4.long	0x6269676e
5.long	0x756d312e
6.long	0x6320342e
7.long	0x3420362f
8.long	0x33302f38
9.long	0x33000000
10.comm	_rusefile,32
11.comm	_relfil,4
12.comm	_listfile,4
13.comm	_liston,4
14.comm	_Znumber,12
15.text
16LL0:.align	1
17.globl	_as_atoi
18.data
19L163:.long	0x10202
20.long	0x3030303
21.long	0x1020303
22.space	4
23.long	0x0
24.space	4
25.long	0x2030000
26.space	4
27.text
28.data	1
29L167:.ascii	"%s%s\12\0"
30.text
31.data	1
32L168:.ascii	"n_n.num_tag != 0\0"
33.text
34.data	1
35L169:.ascii	" Botch width computation\0"
36.text
37.lcomm	L170,12
38.set	L106,0x1c00
39.data
40.text
41_as_atoi:.word	L106
42subl3	$92,fp,sp
43movl	4(fp),r12
44clrl	-92(fp)
45clrl	-88(fp)
46L112:tstb	(r12)
47jeql	L111
48cvtbl	(r12),r0
49cmpl	r0,$43
50jeql	L110
51cmpl	r0,$45
52jeql	L117
53cmpl	r0,$48
54jeql	L110
55L111:movab	-72(fp),r1
56movab	_Znumber,r0
57movl	$12,r2
58movblk
59movab	-84(fp),r1
60movab	_Znumber,r0
61movl	$12,r2
62movblk
63subl3	$72,fp,r11
64pushl	r11
65callf	$8,_numclear
66subl3	$84,fp,-56(fp)
67pushl	-56(fp)
68callf	$8,_numclear
69L120:tstb	(r12)
70jeql	L126
71cvtbl	(r12),r0
72casel	r0,$48,$54
73.align 1
74L2000007:
75.word	L134-L2000007
76.word	L134-L2000007
77.word	L134-L2000007
78.word	L134-L2000007
79.word	L134-L2000007
80.word	L134-L2000007
81.word	L134-L2000007
82.word	L134-L2000007
83.word	L124-L2000007
84.word	L124-L2000007
85.word	L126-L2000007
86.word	L126-L2000007
87.word	L126-L2000007
88.word	L126-L2000007
89.word	L126-L2000007
90.word	L126-L2000007
91.word	L126-L2000007
92.word	L140-L2000007
93.word	L140-L2000007
94.word	L140-L2000007
95.word	L140-L2000007
96.word	L140-L2000007
97.word	L140-L2000007
98.word	L126-L2000007
99.word	L126-L2000007
100.word	L126-L2000007
101.word	L126-L2000007
102.word	L126-L2000007
103.word	L126-L2000007
104.word	L126-L2000007
105.word	L126-L2000007
106.word	L126-L2000007
107.word	L126-L2000007
108.word	L126-L2000007
109.word	L126-L2000007
110.word	L126-L2000007
111.word	L126-L2000007
112.word	L126-L2000007
113.word	L126-L2000007
114.word	L126-L2000007
115.word	L126-L2000007
116.word	L126-L2000007
117.word	L126-L2000007
118.word	L126-L2000007
119.word	L126-L2000007
120.word	L126-L2000007
121.word	L126-L2000007
122.word	L126-L2000007
123.word	L126-L2000007
124.word	L147-L2000007
125.word	L147-L2000007
126.word	L147-L2000007
127.word	L147-L2000007
128.word	L147-L2000007
129.word	L147-L2000007
130L126:pushl	r11
131callf	$8,_posovf
132orl2	r0,-92(fp)
133tstl	-88(fp)
134jeql	L156
135bitl	$8,-92(fp)
136jeql	L157
137andl2	$-13,-92(fp)
138jbr	L156
139L117:xorl2	$1,-88(fp)
140L110:incl	r12
141jbr	L112
142L124:cmpl	8(fp),$10
143jlss	L126
144L134:cvtbl	(r12),r0
145subl3	$48,r0,-60(fp)
146jbr	L121
147L2000001:cmpl	r0,$10
148jeql	L155
149cmpl	r0,$16
150jeql	L154
151L151:pushl	-60(fp)
152pushl	r11
153pushl	r11
154callf	$16,_numaddd
155orl2	r0,-92(fp)
156incl	r12
157jbr	L120
158L140:cmpl	8(fp),$16
159jlss	L126
160cvtbl	(r12),r0
161subl3	$55,r0,-60(fp)
162jbr	L121
163L147:cmpl	8(fp),$16
164jlss	L126
165cvtbl	(r12),r0
166subl3	$87,r0,-60(fp)
167L121:movl	8(fp),r0
168cmpl	r0,$8
169jneq	L2000001
170pushl	r11
171pushl	r11
172pushl	$3
173L2000005:callf	$16,_numshift
174L2000006:orl2	r0,-92(fp)
175jbr	L151
176L154:pushl	r11
177pushl	r11
178pushl	$4
179jbr	L2000005
180L155:pushl	r11
181pushl	-56(fp)
182pushl	$1
183callf	$16,_numshift
184orl2	r0,-92(fp)
185pushl	r11
186pushl	r11
187pushl	$3
188callf	$16,_numshift
189orl2	r0,-92(fp)
190pushl	r11
191pushl	-56(fp)
192pushl	r11
193callf	$16,_numaddv
194jbr	L2000006
195L157:pushl	r11
196pushl	r11
197callf	$12,_numnegate
198orl2	r0,-92(fp)
199L156:tstl	-88(fp)
200jeql	L99999
201mnegl	$1,r0
202jbr	L99998
203L99999:clrl	r0
204L99998:movl	r0,-60(fp)
205clrl	r10
206L2000003:cmpl	(r11)[r10],-60(fp)
207jeql	L160
208aoblss	$2,r10,L2000003
209L160:decl	r10
210jgeq	L164
211clrl	r10
212L164:movb	L163+8[r10],-64(fp)
213jneq	L165
214pushl	$L169
215pushl	$L168
216pushl	$L167
217callf	$16,_panic
218L165:movl	-92(fp),*12(fp)
219subl3	$72,fp,r0
220movab	L170,r1
221movab	(r1),r1
222movab	(r0),r0
223movl	$12,r2
224movblk
225movab	L170,r0
226ret#1
227.align	1
228.globl	_as_atof
229.lcomm	L180,12
230.set	L171,0x0
231.data
232.text
233_as_atof:.word	L171
234subl3	$64,fp,sp
235movab	-64(fp),r1
236movab	_Znumber,r0
237movl	$12,r2
238movblk
239cvtlb	8(fp),-56(fp)
240movl	8(fp),r0
241cmpl	r0,$4
242jeql	L179
243cmpl	r0,$5
244jeql	L178
245L176:subl3	$64,fp,r0
246movab	L180,r1
247movab	(r1),r1
248movab	(r0),r0
249movl	$12,r2
250movblk
251movab	L180,r0
252ret#1
253L178:pushl	4(fp)
254callf	$8,_atof
255movl	r1,-60(fp)
256movl	r0,-64(fp)
257jbr	L176
258L179:pushl	4(fp)
259callf	$8,_atof
260ldd	r0
261cvdf
262stf	-64(fp)
263jbr	L176
264.align	1
265.globl	_posovf
266.set	L181,0x1800
267.data
268.text
269_posovf:.word	L181
270subl3	$56,fp,sp
271movl	4(fp),r12
272clrl	-56(fp)
273bitl	$-2147483648,4(r12)
274jeql	L185
275movl	$4,-56(fp)
276L185:cmpl	4(r12),$-2147483648
277jneq	L2000010
278clrl	r11
279L2000009:tstl	(r12)[r11]
280jeql	L187
281L2000010:movl	-56(fp),r0
282ret#1
283L187:decl	r11
284jgeq	L2000009
285orl2	$8,-56(fp)
286jbr	L2000010
287.align	1
288.globl	_isclear
289.set	L192,0x1000
290.data
291.text
292_isclear:.word	L192
293movl	4(fp),r12
294pushl	$_Znumber
295pushl	r12
296callf	$12,_isunequal
297tstl	r0
298jneq	L99997
299movl	$1,r0
300jbr	L99996
301L99997:clrl	r0
302L99996:ret#1
303.align	1
304.globl	_isunequal
305.set	L197,0x1c00
306.data
307.text
308_isunequal:.word	L197
309movl	4(fp),r12
310movl	8(fp),r11
311movl	$2,r10
312L203:movl	r12,r0
313addl2	$4,r12
314movl	r11,r1
315addl2	$4,r11
316cmpl	(r0),(r1)
317jeql	L202
318movl	r10,r0
319ret#1
320L202:decl	r10
321jneq	L203
322clrl	r0
323ret#1
324.align	1
325.globl	_numclear
326.set	L205,0x1800
327.data
328.text
329_numclear:.word	L205
330movl	4(fp),r12
331movl	$2,r11
332L211:clrl	(r12)
333addl2	$4,r12
334decl	r11
335jneq	L211
336clrl	r0
337ret#1
338.align	1
339.globl	_numshift
340.set	L212,0x1fc0
341.data
342.text
343_numshift:.word	L212
344movl	8(fp),r12
345movl	12(fp),r11
346movl	$2,r10
347tstl	4(fp)
348jneq	L216
349L219:movl	(r11),(r12)
350addl2	$4,r11
351addl2	$4,r12
352decl	r10
353jneq	L219
354clrl	r0
355ret#1
356L216:clrl	r9
357movl	4(fp),r0
358shll	r0,$1,r0
359subl3	$1,r0,r7
360tstl	4(fp)
361jleq	L220
362L223:movl	(r11),r6
363addl2	$4,r11
364subl3	4(fp),$32,r0
365shrl	r0,r6,r0
366andl3	r7,r0,r8
367movl	4(fp),r0
368shll	r0,r6,r6
369mcoml	r7,r0
370andl2	r0,r6
371orl3	r9,r6,(r12)
372addl2	$4,r12
373movl	r8,r9
374decl	r10
375jneq	L223
376tstl	r9
377jeql	L99995
378movl	$2,r0
379jbr	L99994
380L99995:clrl	r0
381L99994:ret#1
382L220:mnegl	4(fp),4(fp)
383addl2	$8,r11
384addl2	$8,r12
385L226:subl2	$4,r11
386movl	(r11),r6
387andl3	r7,r6,r8
388movl	4(fp),r0
389shrl	r0,r6,r6
390subl3	r0,$32,r0
391shll	r0,$1,r0
392decl	r0
393andl2	r0,r6
394orl3	r9,r6,r0
395subl2	$4,r12
396movl	r0,(r12)
397subl3	4(fp),$32,r0
398shll	r0,r8,r9
399decl	r10
400jneq	L226
401tstl	r9
402jeql	L99993
403movl	$2,r0
404jbr	L99992
405L99993:clrl	r0
406L99992:ret#1
407.align	1
408.globl	_numaddd
409.lcomm	L231,12
410.set	L227,0x0
411.data
412.text
413_numaddd:.word	L227
414cvtlb	12(fp),L231+3
415pushl	$L231
416pushl	8(fp)
417pushl	4(fp)
418callf	$16,_numaddv
419ret#1
420.align	1
421.globl	_numaddv
422.set	L232,0x1fc0
423.data
424.text
425_numaddv:.word	L232
426subl3	$56,fp,sp
427movl	4(fp),r12
428movl	8(fp),r11
429movl	12(fp),r10
430clrl	r8
431movl	$2,r9
432L238:movl	(r11),r7
433addl2	$4,r11
434movl	(r10),r6
435addl2	$4,r10
436addl3	r6,r7,r0
437addl3	r8,r0,-56(fp)
438movl	-56(fp),(r12)
439addl2	$4,r12
440clrl	r8
441cmpl	-56(fp),r7
442jlssu	L99991
443cmpl	-56(fp),r6
444jgequ	L237
445L99991:movl	$1,r8
446L237:decl	r9
447jneq	L238
448tstl	r8
449jeql	L99990
450movl	$1,r0
451jbr	L99989
452L99990:clrl	r0
453L99989:ret#1
454.align	1
455.globl	_numnegate
456.set	L240,0x0
457.data
458.text
459_numnegate:.word	L240
460subl3	$56,fp,sp
461pushl	8(fp)
462pushl	4(fp)
463callf	$12,_num1comp
464movl	r0,-56(fp)
465pushl	$1
466pushl	4(fp)
467pushl	4(fp)
468callf	$16,_numaddd
469orl2	r0,-56(fp)
470movl	-56(fp),r0
471ret#1
472.align	1
473.globl	_num1comp
474.set	L244,0x1c00
475.data
476.text
477_num1comp:.word	L244
478movl	4(fp),r12
479movl	8(fp),r11
480movl	$2,r10
481L250:mcoml	(r11),(r12)
482addl2	$4,r11
483addl2	$4,r12
484decl	r10
485jneq	L250
486clrl	r0
487ret#1
488.align	1
489.globl	_bignumprint
490.data	1
491L260:.ascii	"val[msd] = 0x%x, val[lsd] = 0x%x.\0"
492.text
493.data	1
494L262:.ascii	"value %20.17f\0"
495.text
496.data	1
497L264:.ascii	"value %20.17f\0"
498.text
499.set	L252,0x0
500.data
501.text
502_bignumprint:.word	L252
503movl	_num_type,r0
504cmpl	r0,$3
505jeql	L258
506cmpl	r0,$4
507jeql	L261
508cmpl	r0,$5
509jeql	L263
510L256:ret#2
511L258:pushl	4(fp)
512pushl	8(fp)
513pushl	$L260
514L2000011:callf	$16,_printf
515jbr	L256
516L261:pushl	$0
517pushl	4(fp)
518pushl	$L262
519jbr	L2000011
520L263:pushl	8(fp)
521pushl	4(fp)
522pushl	$L264
523jbr	L2000011
524
525