source: buchla-68k/alcyon/dofmt.s@ 7bb1284

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

Added Alcyon C reference output.

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