source: buchla-68k/alcyon/scan.s@ 9519422

Last change on this file since 9519422 was 7bf3856, checked in by Thomas Lopatic <thomas@…>, 7 years ago

Added Alcyon C reference output.

  • Property mode set to 100644
File size: 9.2 KB
Line 
1.globl _Cbuffs
2.globl _Stdbufs
3.globl _Stdbuf
4.globl ___atab
5.bss
6L1:.ds.b 2
7.text
8.bss
9L2:.ds.b 4
10.text
11.bss
12L3:.ds.b 4
13.text
14.bss
15L4:.ds.b 2
16.text
17.text
18_getnum:
19~~getnum:
20~list=8
21~values=12
22~base=16
23link R14,#-4
24movem.l R6-R7/R13-R13,-(sp)
25~val=R7
26~cp=R13
27~c=-2
28~sign=-4
29*line 35
30*line 36
31tst L1
32bgt L7
33*line 36
34clr.l R0
35bra L6
36*line 37
37L7:
38*line 38
39clr R0
40move R0,-4(R14)
41ext.l R0
42move.l R0,R7
43*line 40
44*line 40
45clr -(sp)
46move.l L2,R8
47jsr (R8)
48addq.l #2,sp
49move R0,-2(R14)
50cmp #45,R0
51bne L8
52*line 41
53*line 42
54move #1,-4(R14)
55*line 43
56sub #1,L1
57*line 44
58bra L9
59L8:
60*line 45
61*line 46
62cmp #43,-2(R14)
63bne L10
64*line 46
65sub #1,L1
66*line 47
67bra L11
68L10:
69*line 48
70move #1,-(sp)
71move.l L2,R8
72jsr (R8)
73addq.l #2,sp
74L11:L9:
75*line 50
76bra L14
77L13:
78*line 51
79*line 52
80*line 52
81clr -(sp)
82move.l L2,R8
83jsr (R8)
84addq.l #2,sp
85move R0,(sp)
86move.l 8(R14),-(sp)
87jsr _index
88addq.l #4,sp
89move.l R0,R13
90move.l R13,R0
91bne L15
92*line 53
93*line 54
94move #1,-(sp)
95move.l L2,R8
96jsr (R8)
97addq.l #2,sp
98bra L12
99*line 55
100*line 56
101*line 57
102L15:
103*line 58
104move 16(R14),R0
105ext.l R0
106move.l R0,-(sp)
107move.l R7,-(sp)
108jsr lmul
109addq.l #8,sp
110move.l R0,R7
111*line 59
112move.l 12(R14),R8
113move.l R13,R9
114sub.l 8(R14),R9
115move.b 0(R8,R9.l),R0
116ext.w R0
117ext.l R0
118add.l R0,R7
119L14:
120*line 60
121move L1,R0
122sub #1,L1
123tst R0
124bne L13
125L12:
126*line 62
127*line 63
128tst -4(R14)
129beq L16
130*line 63
131move.l R7,R0
132neg.l R0
133move.l R0,R7
134*line 64
135L16:
136*line 65
137move.l R7,R0
138bra L6
139L6:tst.l (sp)+
140movem.l (sp)+,R7-R7/R13-R13
141unlk R14
142rts
143.text
144_skipblk:
145~~skipblk:
146link R14,#-4
147*line 74
148bra L21
149L20:L21:
150*line 75
151clr -(sp)
152move.l L2,R8
153jsr (R8)
154addq.l #2,sp
155ext.l R0
156add.l #___atab,R0
157move.l R0,R8
158btst #5,(R8)
159bne L20
160L19:
161*line 77
162*line 78
163move #1,-(sp)
164move.l L2,R8
165jsr (R8)
166addq.l #2,sp
167cmp #-1,R0
168bne L22
169*line 78
170move #-1,R0
171bra L18
172*line 79
173L22:
174*line 80
175clr R0
176bra L18
177L18:unlk R14
178rts
179.text
180_sgetc:
181~~sgetc:
182~what=8
183link R14,#-4
184*line 86
185*line 86
186tst 8(R14)
187bne L25
188*line 87
189*line 88
190*line 89
191move.l L3,R8
192tst.b (R8)
193beq L26
194*line 89
195move.l L3,R8
196move.b (R8),R0
197ext.w R0
198and #255,R0
199add.l #1,L3
200bra L24
201*line 90
202L26:
203*line 91
204move.b #1,L4
205*line 92
206bra L27
207L25:
208*line 93
209*line 94
210*line 95
211*line 96
212tst.b L4
213bne L28
214*line 96
215sub.l #1,L3
216move.l L3,R8
217move.b (R8),R0
218ext.w R0
219and #255,R0
220bra L24
221L28:L27:
222*line 99
223move #-1,R0
224bra L24
225L24:unlk R14
226rts
227.globl _scanfmt
228.text
229_scanfmt:
230~~scanfmt:
231~fmt=R13
232~getsub=8
233~args=16
234link R14,#-148
235movem.l R7-R7/R13-R13,-(sp)
236~lv=-4
237~c=-6
238~count=-8
239~dontdo=-10
240~lflag=-12
241~base=-14
242~cp=-18
243~tlist=-148
244~list=L30
245.data
246L30:.dc.b $41,$42,$43,$44,$45,$46,$61,$62,$63,$64,$65,$66,$39,$38,$37,$36,$35,$34,$33,$32,$31,$30,$0
247.even
248.text
249~vals=L32
250.data
251L32:.dc.b $A
252.dc.b $B
253.dc.b $C
254.dc.b $D
255.dc.b $E
256.dc.b $F
257.dc.b $A
258.dc.b $B
259.dc.b $C
260.dc.b $D
261.dc.b $E
262.dc.b $F
263.dc.b $9
264.dc.b $8
265.dc.b $7
266.dc.b $6
267.dc.b $5
268.dc.b $4
269.dc.b $3
270.dc.b $2
271.dc.b $1
272.dc.b $0
273.text
274*line 129
275move.l 12(R14),R13
276*line 129
277clr -8(R14)
278*line 130
279move.l 8(R14),L2
280*line 132
281bra L35
282L34:
283*line 133
284*line 134
285*line 134
286cmp #37,-6(R14)
287bne L36
288*line 135
289*line 136
290clr R0
291move R0,-10(R14)
292move R0,-12(R14)
293*line 137
294move #127,L1
295*line 138
296*line 139
297*line 139
298cmp.b #42,(R13)
299bne L37
300*line 140
301add.l #1,R13
302*line 141
303move #1,-10(R14)
304*line 142
305*line 143
306L37:
307*line 144
308*line 144
309move.b (R13),R0
310ext.w R0
311ext.l R0
312add.l #___atab,R0
313move.l R0,R8
314btst #2,(R8)
315beq L38
316*line 145
317*line 146
318clr L1
319*line 147
320*line 148
321L41:
322*line 149
323*line 150
324move L1,R0
325muls #10,R0
326move.b (R13),R1
327ext.w R1
328add R1,R0
329add #-48,R0
330move R0,L1
331*line 151
332L40:
333*line 152
334add.l #1,R13
335move.b (R13),R0
336ext.w R0
337ext.l R0
338add.l #___atab,R0
339move.l R0,R8
340btst #2,(R8)
341bne L41
342L39:
343*line 153
344*line 154
345L38:
346*line 155
347*line 155
348cmp.b #108,(R13)
349bne L42
350*line 156
351*line 157
352move #1,-12(R14)
353*line 158
354add.l #1,R13
355*line 159
356*line 160
357*line 161
358*line 162
359L42:
360*line 163
361move.b (R13)+,R0
362ext.w R0
363bra L44
364*line 164
365L45:
366*line 165
367*line 166
368move #37,-6(R14)
369bra L46
370*line 167
371*line 168
372L47:
373*line 169
374*line 170
375clr -12(R14)
376bra L48
377*line 171
378*line 172
379L49:
380*line 173
381*line 174
382move #1,-12(R14)
383*line 175
384L50:
385*line 176
386L48:
387*line 177
388*line 178
389move #12,-6(R14)
390*line 179
391move #10,-14(R14)
392bra L51
393*line 180
394*line 181
395L52:
396*line 182
397*line 183
398move #1,-12(R14)
399*line 184
400L53:
401*line 185
402*line 186
403clr -6(R14)
404*line 187
405move #16,-14(R14)
406bra L51
407*line 188
408*line 189
409L54:
410*line 190
411*line 191
412move #1,-12(R14)
413*line 192
414L55:
415*line 193
416*line 194
417move #14,-6(R14)
418*line 195
419move #8,-14(R14)
420L51:
421*line 196
422*line 197
423*line 198
424jsr _skipblk
425tst R0
426bne L56
427*line 199
428*line 200
429move -14(R14),(sp)
430move.l #L32,R0
431move -6(R14),R1
432ext.l R1
433add.l R1,R0
434move.l R0,-(sp)
435move.l #L30,R0
436move -6(R14),R1
437ext.l R1
438add.l R1,R0
439move.l R0,-(sp)
440jsr _getnum
441addq.l #8,sp
442move.l R0,-4(R14)
443*line 201
444*line 202
445*line 202
446tst -10(R14)
447bne L57
448*line 203
449*line 204
450*line 205
451tst -12(R14)
452beq L58
453*line 205
454move.l 16(R14),R8
455move.l (R8),R8
456move.l -4(R14),(R8)
457add.l #4,16(R14)
458*line 206
459bra L59
460L58:
461*line 207
462move.l -4(R14),R0
463move.l 16(R14),R9
464move.l (R9),R9
465move R0,(R9)
466add.l #4,16(R14)
467L59:
468*line 208
469add #1,-8(R14)
470*line 209
471*line 210
472L57:bra L43
473*line 211
474*line 212
475*line 213
476*line 214
477*line 237
478*line 238
479*line 239
480*line 240
481*line 241
482L60:
483*line 242
484*line 243
485clr -12(R14)
486*line 244
487*line 245
488*line 245
489cmp.b #94,(R13)
490beq L10000
491cmp.b #126,(R13)
492bne L61
493L10000:*line 246
494*line 247
495add.l #1,R13
496*line 248
497move #1,-12(R14)
498*line 249
499*line 250
500L61:
501*line 251
502lea -148(R14),R8
503move.l R8,-18(R14)
504bra L64
505L65:
506*line 252
507move -6(R14),R0
508move.l -18(R14),R9
509move.b R0,(R9)
510add.l #1,-18(R14)
511L63:L64:
512*line 251
513move.b (R13)+,R0
514ext.w R0
515move R0,-6(R14)
516cmp #93,R0
517bne L65
518L62:
519*line 252
520*line 253
521*line 254
522move.l -18(R14),R8
523clr.b (R8)
524bra L66
525*line 255
526*line 256
527L67:
528*line 257
529*line 258
530move #1,-12(R14)
531*line 259
532move.b #32,-148(R14)
533*line 260
534move.b #9,-147(R14)
535*line 261
536move.b #10,-146(R14)
537*line 262
538clr.b -145(R14)
539L66:
540*line 263
541*line 264
542*line 265
543jsr _skipblk
544tst R0
545bne L56
546*line 266
547*line 267
548*line 268
549tst -10(R14)
550bne L68
551*line 268
552move.l 16(R14),R8
553move.l (R8),-18(R14)
554add.l #4,16(R14)
555*line 269
556L68:
557*line 270
558bra L71
559L70:
560*line 271
561*line 272
562*line 273
563clr -(sp)
564move.l L2,R8
565jsr (R8)
566addq.l #2,sp
567move R0,-6(R14)
568cmp #-1,R0
569beq L69
570*line 274
571*line 275
572*line 276
573*line 277
574tst -12(R14)
575beq L10001
576move -6(R14),(sp)
577move.l R14,-(sp)
578add.l #-148,(sp)
579jsr _index
580addq.l #4,sp
581tst.l R0
582bne L10002
583clr R0
584bra L10003
585L10002:move #1,R0
586L10003:bra L10005
587L10001:move -6(R14),(sp)
588move.l R14,-(sp)
589add.l #-148,(sp)
590jsr _index
591addq.l #4,sp
592tst.l R0
593beq L10006
594clr R0
595bra L10007
596L10006:move #1,R0
597L10007:L10005:tst R0
598beq L72
599*line 278
600*line 279
601move #1,-(sp)
602move.l L2,R8
603jsr (R8)
604addq.l #2,sp
605bra L69
606*line 280
607*line 281
608*line 282
609L72:
610*line 283
611*line 284
612tst -10(R14)
613bne L73
614*line 284
615move -6(R14),R0
616move.l -18(R14),R9
617move.b R0,(R9)
618add.l #1,-18(R14)
619L73:L71:
620*line 285
621move L1,R0
622sub #1,L1
623tst R0
624bne L70
625L69:
626*line 286
627*line 287
628*line 287
629tst -10(R14)
630bne L74
631*line 288
632*line 289
633move.l -18(R14),R8
634clr.b (R8)
635*line 290
636add #1,-8(R14)
637*line 291
638*line 292
639L74:bra L43
640*line 293
641*line 294
642*line 295
643L75:
644*line 296
645*line 297
646*line 298
647clr -(sp)
648move.l L2,R8
649jsr (R8)
650addq.l #2,sp
651move R0,-6(R14)
652cmp #-1,R0
653beq L56
654*line 299
655*line 300
656*line 300
657tst -10(R14)
658bne L76
659*line 301
660*line 302
661move -6(R14),R0
662move.l 16(R14),R9
663move.l (R9),R9
664move.b R0,(R9)
665add.l #4,16(R14)
666*line 303
667add #1,-8(R14)
668*line 304
669*line 305
670L76:bra L43
671*line 306
672bra L43
673L44:ext.l R0
674move.l #L77,R8
675move #11,R1
676L78:cmp.l (R8)+,R0
677dbeq R1,L78
678move.l 44(R8),R8
679jmp (R8)
680.data
681L77:.dc.l 37
682.dc.l 68
683.dc.l 79
684.dc.l 88
685.dc.l 91
686.dc.l 99
687.dc.l 100
688.dc.l 104
689.dc.l 111
690.dc.l 115
691.dc.l 120
692.dc.l 0
693.dc.l L45
694.dc.l L49
695.dc.l L54
696.dc.l L52
697.dc.l L60
698.dc.l L75
699.dc.l L50
700.dc.l L47
701.dc.l L55
702.dc.l L67
703.dc.l L53
704.dc.l L43
705.text
706L43:
707*line 307
708*line 308
709bra L79
710L36:
711*line 309
712*line 309
713move.l #___atab,R8
714move -6(R14),R9
715add.l R9,R8
716btst #5,(R8)
717beq L80
718*line 310
719*line 311
720*line 311
721jsr _skipblk
722tst R0
723beq L81
724L56:
725*line 312
726*line 313
727*line 314
728tst -8(R14)
729bne L82
730*line 314
731move #-1,R0
732bra L29
733*line 315
734L82:
735*line 316
736move -8(R14),R0
737bra L29
738*line 317
739*line 318
740L81:bra L83
741L80:
742*line 319
743*line 320
744L46:
745*line 321
746*line 322
747*line 323
748jsr _skipblk
749tst R0
750bne L56
751*line 324
752*line 325
753*line 326
754clr -(sp)
755move.l L2,R8
756jsr (R8)
757addq.l #2,sp
758cmp -6(R14),R0
759beq L84
760*line 326
761move -8(R14),R0
762bra L29
763L84:L83:L79:
764*line 327
765L35:
766*line 328
767move.b (R13)+,R0
768ext.w R0
769move R0,-6(R14)
770bne L34
771L33:
772*line 330
773move -8(R14),R0
774bra L29
775L29:tst.l (sp)+
776movem.l (sp)+,R13-R13
777unlk R14
778rts
779.globl _sscanf
780.text
781_sscanf:
782~~sscanf:
783~string=8
784~fmt=12
785~args=16
786link R14,#-4
787*line 385
788move.l 8(R14),L3
789*line 386
790clr.b L4
791*line 387
792move.l R14,(sp)
793add.l #16,(sp)
794move.l 12(R14),-(sp)
795move.l #_sgetc,-(sp)
796jsr _scanfmt
797addq.l #8,sp
798bra L85
799L85:unlk R14
800rts
801.data
Note: See TracBrowser for help on using the repository browser.