Mercurial > hg > Members > kono > nitros9-code
comparison lib/kreiderclib/pffinit.as @ 2824:1647f1874cdf lwtools-port
Added Kreidier C library
author | Boisy Pitre <boisy.pitre@nuance.com> |
---|---|
date | Thu, 23 May 2013 05:49:13 -0500 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
2823:ad769d2a03e4 | 2824:1647f1874cdf |
---|---|
1 * Disassembly by Os9disasm of pffinit.r | |
2 | |
3 section bss | |
4 | |
5 * Uninitialized data (class D) | |
6 D0000 rmb 1 | |
7 * Initialized Data (class H) | |
8 | |
9 endsect | |
10 | |
11 | |
12 section bss | |
13 | |
14 * Uninitialized data (class B) | |
15 B0000 rmb 1 | |
16 B0001 rmb 29 | |
17 B001e rmb 0 | |
18 * Initialized Data (class G) | |
19 G0000 fcb $00 | |
20 fcb $00 | |
21 fcb $00 | |
22 fcb $00 | |
23 fcb $00 | |
24 fcb $00 | |
25 fcb $00 | |
26 fcb $81 | |
27 fcb $4c | |
28 fcb $cc | |
29 fcb $cc | |
30 fcb $cc | |
31 fcb $cc | |
32 fcb $cc | |
33 fcb $cd | |
34 fcb $7d | |
35 fcb $23 | |
36 fcb $d7 | |
37 fcb $0a | |
38 fcb $3d | |
39 fcb $70 | |
40 fcb $a3 | |
41 fcb $d7 | |
42 fcb $7a | |
43 fcb $03 | |
44 fcb $12 | |
45 fcb $6e | |
46 fcb $97 | |
47 fcb $8d | |
48 fcb $4f | |
49 fcb $df | |
50 fcb $77 | |
51 fcb $51 | |
52 fcb $b7 | |
53 fcb $17 | |
54 fcb $58 | |
55 fcb $e2 | |
56 fcb $19 | |
57 fcb $65 | |
58 fcb $73 | |
59 fcb $27 | |
60 fcb $c5 | |
61 fcb $ac | |
62 fcb $47 | |
63 fcb $1b | |
64 fcb $47 | |
65 fcb $84 | |
66 fcb $70 | |
67 fcb $06 | |
68 fcb $37 | |
69 fcb $bd | |
70 fcb $05 | |
71 fcb $af | |
72 fcb $6c | |
73 fcb $6a | |
74 fcb $6d | |
75 fcb $56 | |
76 fcb $bf | |
77 fcb $94 | |
78 fcb $d5 | |
79 fcb $e5 | |
80 fcb $7a | |
81 fcb $43 | |
82 fcb $69 | |
83 fcb $2b | |
84 fcb $cc | |
85 fcb $77 | |
86 fcb $11 | |
87 fcb $84 | |
88 fcb $61 | |
89 fcb $cf | |
90 fcb $66 | |
91 fcb $09 | |
92 fcb $70 | |
93 fcb $5f | |
94 fcb $41 | |
95 fcb $36 | |
96 fcb $b4 | |
97 fcb $a6 | |
98 fcb $63 | |
99 fcb $5b | |
100 fcb $e6 | |
101 fcb $fe | |
102 fcb $ce | |
103 fcb $bd | |
104 fcb $ed | |
105 fcb $d6 | |
106 fcb $5f | |
107 fcb $2f | |
108 fcb $eb | |
109 fcb $ff | |
110 fcb $0b | |
111 fcb $cb | |
112 fcb $24 | |
113 fcb $ab | |
114 fcb $5c | |
115 fcb $0c | |
116 fcb $bc | |
117 fcb $cc | |
118 fcb $09 | |
119 fcb $6f | |
120 fcb $50 | |
121 fcb $89 | |
122 fcb $59 | |
123 fcb $61 | |
124 fcb $2e | |
125 fcb $13 | |
126 fcb $42 | |
127 fcb $4b | |
128 fcb $b4 | |
129 fcb $0e | |
130 fcb $55 | |
131 fcb $34 | |
132 fcb $24 | |
133 fcb $dc | |
134 fcb $35 | |
135 fcb $09 | |
136 fcb $5c | |
137 fcb $d8 | |
138 fcb $52 | |
139 fcb $10 | |
140 fcb $1d | |
141 fcb $7c | |
142 fcb $f7 | |
143 fcb $3a | |
144 fcb $b0 | |
145 fcb $ad | |
146 fcb $4f | |
147 fcb $66 | |
148 fcb $95 | |
149 fcb $94 | |
150 fcb $be | |
151 fcb $c4 | |
152 fcb $4d | |
153 fcb $e1 | |
154 fcb $4b | |
155 fcb $38 | |
156 fcb $77 | |
157 fcb $aa | |
158 fcb $32 | |
159 fcb $36 | |
160 fcb $a4 | |
161 fcb $b4 | |
162 fcb $48 | |
163 fdb G0090 | |
164 | |
165 endsect | |
166 | |
167 section code | |
168 | |
169 pffinit: pshs u | |
170 puls u,pc | |
171 pffloat: pshs d,u | |
172 ldx 6,s | |
173 bra L001a | |
174 L000a ldd #1 | |
175 bra L0016 | |
176 L000f ldd #-1 | |
177 bra L0016 | |
178 L0014 clra | |
179 clrb | |
180 L0016 std ,s | |
181 bra L0037 | |
182 L001a cmpx #'f | |
183 beq L000a | |
184 cmpx #'e | |
185 beq L000f | |
186 cmpx #'E | |
187 lbeq L000f | |
188 cmpx #'g | |
189 beq L0014 | |
190 cmpx #'G | |
191 lbeq L0014 | |
192 L0037 ldd 6,s | |
193 leax _chcodes,y | |
194 leax d,x | |
195 ldb ,x | |
196 clra | |
197 andb #2 | |
198 pshs d | |
199 ldd 2,s | |
200 pshs d | |
201 ldd 12,s | |
202 pshs d | |
203 ldd [16,s] | |
204 addd #8 | |
205 std [16,s] | |
206 subd #8 | |
207 pshs d | |
208 bsr L0064 | |
209 leas 8,s | |
210 leas 2,s | |
211 puls u,pc | |
212 L0064 pshs u | |
213 leas -32,s | |
214 ldd #1 | |
215 std 8,s | |
216 leax ,s | |
217 pshs x | |
218 ldx 38,s | |
219 lbsr _dmove | |
220 leau ,s | |
221 ldb 7,u | |
222 bne L008f | |
223 clra | |
224 clrb | |
225 std 24,s | |
226 std 26,s | |
227 std 18,s | |
228 leax 32,s | |
229 lbra L0181 | |
230 L008f ldb 7,u | |
231 clra | |
232 addd #-128 | |
233 std 22,s | |
234 bge L00a9 | |
235 ldd 22,s | |
236 nega | |
237 negb | |
238 sbca #0 | |
239 std 22,s | |
240 ldd #1 | |
241 bra L00ab | |
242 L00a9 clra | |
243 clrb | |
244 L00ab std 24,s | |
245 ldd 22,s | |
246 pshs d | |
247 ldd #78 | |
248 lbsr ccmult | |
249 pshs d | |
250 ldd #8 | |
251 lbsr ccasr | |
252 std 20,s | |
253 ldd 24,s | |
254 beq L00d2 | |
255 ldd 20,s | |
256 nega | |
257 negb | |
258 sbca #0 | |
259 bra L00d5 | |
260 L00d2 ldd 20,s | |
261 L00d5 addd #1 | |
262 std 18,s | |
263 ldb ,u | |
264 bge L00eb | |
265 ldb ,u | |
266 clra | |
267 andb #$7f | |
268 stb ,u | |
269 ldd #1 | |
270 bra L00ed | |
271 L00eb clra | |
272 clrb | |
273 L00ed std 26,s | |
274 leax ,s | |
275 pshs x | |
276 ldd 26,s | |
277 pshs d | |
278 ldd 24,s | |
279 pshs d | |
280 leax 6,s | |
281 lbsr _dstack | |
282 lbsr scale | |
283 leas 12,s | |
284 lbsr _dmove | |
285 bra L012f | |
286 L010d leax ,s | |
287 pshs x | |
288 lbsr _dstack | |
289 bsr L011e | |
290 fdb 8192,0,0,132 | |
291 L011e puls x | |
292 lbsr _dmul | |
293 lbsr _dmove | |
294 ldd 18,s | |
295 addd #-1 | |
296 std 18,s | |
297 L012f leax ,s | |
298 lbsr _dstack | |
299 bsr L013e | |
300 fdb 0,0,0,129 | |
301 L013e puls x | |
302 lbsr _dcmpr | |
303 blt L010d | |
304 bra L0169 | |
305 L0147 leax ,s | |
306 pshs x | |
307 lbsr _dstack | |
308 bsr L0158 | |
309 fdb 8192,0,0,132 | |
310 L0158 puls x | |
311 lbsr _ddiv | |
312 lbsr _dmove | |
313 ldd 18,s | |
314 addd #1 | |
315 std 18,s | |
316 L0169 leax ,s | |
317 lbsr _dstack | |
318 bsr L0178 | |
319 fdb 8192,0,0,132 | |
320 L0178 puls x | |
321 lbsr _dcmpr | |
322 bge L0147 | |
323 bra L0184 | |
324 L0181 leas -32,x | |
325 L0184 leax B0000,y | |
326 stx 30,s | |
327 ldd #'0 | |
328 ldx 30,s | |
329 leax 1,x | |
330 stx 30,s | |
331 stb -1,x | |
332 ldd 26,s | |
333 beq L01aa | |
334 ldd #'- | |
335 ldx 30,s | |
336 leax 1,x | |
337 stx 30,s | |
338 stb -1,x | |
339 L01aa ldd 38,s | |
340 cmpd #$0010 | |
341 ble L01b8 | |
342 ldd #$0010 | |
343 bra L01bf | |
344 L01b8 ldd 38,s | |
345 bge L01c2 | |
346 clra | |
347 clrb | |
348 L01bf std 38,s | |
349 L01c2 clra | |
350 clrb | |
351 std 10,s | |
352 ldd 40,s | |
353 bne L01e0 | |
354 ldd #1 | |
355 std 10,s | |
356 ldd 18,s | |
357 cmpd #5 | |
358 lbgt L0252 | |
359 leax 32,s | |
360 bra L0213 | |
361 L01e0 ldd 40,s | |
362 bge L0216 | |
363 bra L01ea | |
364 L01e7 leas -32,x | |
365 L01ea ldd #1 | |
366 std 16,s | |
367 ldd #1 | |
368 std 12,s | |
369 leax ,s | |
370 lbsr _dstack | |
371 bsr L0204 | |
372 fdb 0,0,0,0 | |
373 L0204 puls x | |
374 lbsr _dcmpr | |
375 bne L0258 | |
376 ldd #1 | |
377 std 18,s | |
378 bra L0258 | |
379 L0213 leas -32,x | |
380 L0216 clra | |
381 clrb | |
382 std 16,s | |
383 ldd 18,s | |
384 std 12,s | |
385 bge L0247 | |
386 ldd 12,s | |
387 addd 38,s | |
388 blt L0233 | |
389 ldd 38,s | |
390 addd 12,s | |
391 std 38,s | |
392 bra L0258 | |
393 L0233 ldd 38,s | |
394 nega | |
395 negb | |
396 sbca #0 | |
397 std 12,s | |
398 clra | |
399 clrb | |
400 std 38,s | |
401 clra | |
402 clrb | |
403 std 8,s | |
404 bra L0258 | |
405 L0247 ldd 12,s | |
406 addd 38,s | |
407 cmpd #$0019 | |
408 ble L0258 | |
409 L0252 leax 32,s | |
410 lbra L01e7 | |
411 L0258 leax G0000,y | |
412 stx 14,s | |
413 leax ,s | |
414 pshs x | |
415 lbsr L0464 | |
416 leas 2,s | |
417 ldd 12,s | |
418 bge L029e | |
419 ldd #'0 | |
420 ldx 30,s | |
421 leax 1,x | |
422 stx 30,s | |
423 stb -1,x | |
424 ldd 30,s | |
425 std 28,s | |
426 ldd #'. | |
427 bra L0286 | |
428 L0283 ldd #'0 | |
429 L0286 ldx 30,s | |
430 leax 1,x | |
431 stx 30,s | |
432 stb -1,x | |
433 ldd 12,s | |
434 addd #1 | |
435 std 12,s | |
436 subd #1 | |
437 bne L0283 | |
438 bra L02f1 | |
439 L029e ldd 12,s | |
440 bne L02be | |
441 ldd #'0 | |
442 bra L02b4 | |
443 L02a7 leax 14,s | |
444 pshs x | |
445 leax 2,s | |
446 pshs x | |
447 lbsr L049c | |
448 leas 4,s | |
449 L02b4 ldx 30,s | |
450 leax 1,x | |
451 stx 30,s | |
452 stb -1,x | |
453 L02be ldd 12,s | |
454 addd #-1 | |
455 std 12,s | |
456 subd #-1 | |
457 bne L02a7 | |
458 ldd 30,s | |
459 std 28,s | |
460 ldd 38,s | |
461 beq L02f1 | |
462 ldd #'. | |
463 bra L02e7 | |
464 L02da leax 14,s | |
465 pshs x | |
466 leax 2,s | |
467 pshs x | |
468 lbsr L049c | |
469 leas 4,s | |
470 L02e7 ldx 30,s | |
471 leax 1,x | |
472 stx 30,s | |
473 stb -1,x | |
474 L02f1 ldd 38,s | |
475 addd #-1 | |
476 std 38,s | |
477 subd #-1 | |
478 bgt L02da | |
479 ldd 8,s | |
480 lbeq L037b | |
481 leas -4,s | |
482 ldd 34,s | |
483 std ,s | |
484 tfr d,x | |
485 pshs x | |
486 leax 20,s | |
487 pshs x | |
488 leax 8,s | |
489 pshs x | |
490 lbsr L049c | |
491 leas 4,s | |
492 stb [,s++] | |
493 ldd #5 | |
494 std 2,s | |
495 L0325 ldb [,s] | |
496 sex | |
497 tfr d,x | |
498 bra L0343 | |
499 L032c ldd ,s | |
500 addd #-1 | |
501 std ,s | |
502 bra L034d | |
503 L0335 ldd #'- | |
504 ldx ,s | |
505 stb -1,x | |
506 ldd #'0 | |
507 stb [,s] | |
508 bra L034d | |
509 L0343 cmpx #'. | |
510 beq L032c | |
511 cmpx #'- | |
512 beq L0335 | |
513 L034d ldb [,s] | |
514 sex | |
515 addd 2,s | |
516 stb [,s] | |
517 cmpd #'9 | |
518 ble L035f | |
519 ldd #1 | |
520 bra L0361 | |
521 L035f clra | |
522 clrb | |
523 L0361 std 2,s | |
524 beq L0379 | |
525 ldb [,s] | |
526 sex | |
527 subd #10 | |
528 stb [,s] | |
529 bra L036f | |
530 L036f ldd ,s | |
531 addd #-1 | |
532 std ,s | |
533 lbra L0325 | |
534 L0379 leas 4,s | |
535 L037b ldd 16,s | |
536 lbeq L03f2 | |
537 ldd 42,s | |
538 beq L038c | |
539 ldd #'E | |
540 bra L038f | |
541 L038c ldd #'e | |
542 L038f ldx 30,s | |
543 leax 1,x | |
544 stx 30,s | |
545 stb -1,x | |
546 ldd 18,s | |
547 addd #-1 | |
548 std 18,s | |
549 bge L03b3 | |
550 ldd 18,s | |
551 nega | |
552 negb | |
553 sbca #0 | |
554 std 18,s | |
555 ldd #$002d | |
556 bra L03b6 | |
557 L03b3 ldd #'+ | |
558 L03b6 ldx 30,s | |
559 leax 1,x | |
560 stx 30,s | |
561 stb -1,x | |
562 ldd 18,s | |
563 pshs d | |
564 ldd #10 | |
565 lbsr ccdiv | |
566 addd #'0 | |
567 ldx 30,s | |
568 leax 1,x | |
569 stx 30,s | |
570 stb -1,x | |
571 ldd 18,s | |
572 pshs d | |
573 ldd #10 | |
574 lbsr ccmod | |
575 addd #'0 | |
576 ldx 30,s | |
577 leax 1,x | |
578 stx 30,s | |
579 stb -1,x | |
580 bra L0422 | |
581 L03f2 ldd 10,s | |
582 beq L0422 | |
583 ldd 30,s | |
584 cmpd 28,s | |
585 beq L0422 | |
586 bra L0413 | |
587 L0401 ldb [30,s] | |
588 cmpb #'0 | |
589 beq L0413 | |
590 ldd 30,s | |
591 addd #1 | |
592 std 30,s | |
593 bra L0422 | |
594 L0413 ldd 30,s | |
595 addd #-1 | |
596 std 30,s | |
597 cmpd 28,s | |
598 bne L0401 | |
599 L0422 clra | |
600 clrb | |
601 stb [30,s] | |
602 leax B001e,y | |
603 cmpx 30,s | |
604 bhi L044b | |
605 leax L04eb,pcr | |
606 pshs x | |
607 leax _iob+26,y | |
608 pshs x | |
609 lbsr fprintf | |
610 leas 4,s | |
611 ldd #1 | |
612 pshs d | |
613 lbsr exit | |
614 leas 2,s | |
615 L044b ldb B0000,y | |
616 cmpb #'0 | |
617 bne L0459 | |
618 leax B0001,y | |
619 bra L045d | |
620 L0459 leax B0000,y | |
621 L045d tfr x,d | |
622 leas 32,s | |
623 puls u,pc | |
624 L0464 pshs u | |
625 ldx 4,s | |
626 lda 7,x | |
627 suba #$80 | |
628 bcs L0496 | |
629 ldb ,x | |
630 orb #$80 | |
631 stb ,x | |
632 clr 7,x | |
633 suba #4 | |
634 beq L048d | |
635 L047a lsr ,x | |
636 ror 1,x | |
637 ror 2,x | |
638 ror 3,x | |
639 ror 4,x | |
640 ror 5,x | |
641 ror 6,x | |
642 ror 7,x | |
643 inca | |
644 bne L047a | |
645 L048d lda #8 | |
646 L048f deca | |
647 bmi L0496 | |
648 ldb a,x | |
649 beq L048f | |
650 L0496 sta D0000 | |
651 clra | |
652 clrb | |
653 puls u,pc | |
654 L049c ldx 2,s | |
655 clra | |
656 ldb ,x | |
657 lsrb | |
658 lsrb | |
659 lsrb | |
660 lsrb | |
661 addb #'0 | |
662 pshs d,u | |
663 ldb ,x | |
664 andb #$0f | |
665 stb ,x | |
666 bsr L04dd | |
667 lda D0000 | |
668 bmi L04db | |
669 L04b5 ldb a,x | |
670 bne L04bc | |
671 deca | |
672 bpl L04b5 | |
673 L04bc sta D0000 | |
674 bmi L04db | |
675 leas -8,s | |
676 L04c2 ldb a,x | |
677 stb a,s | |
678 deca | |
679 bpl L04c2 | |
680 bsr L04dd | |
681 bsr L04dd | |
682 lda D0000 | |
683 clrb | |
684 L04d0 ldb a,x | |
685 adcb a,s | |
686 stb a,x | |
687 deca | |
688 bpl L04d0 | |
689 leas 8,s | |
690 L04db puls d,u,pc | |
691 L04dd lda D0000 | |
692 bmi L04ea | |
693 asl a,x | |
694 bra L04e7 | |
695 L04e5 rol a,x | |
696 L04e7 deca | |
697 bpl L04e5 | |
698 L04ea rts | |
699 L04eb fcc "pffinit buffer overflow" | |
700 fcb $0d,$00 | |
701 | |
702 endsect | |
703 |