-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrdTap.lst
12966 lines (12962 loc) · 433 KB
/
rdTap.lst
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
CCS PCH C Compiler, Version 5.117, 2295 16-Oct-24 09:30
Filename: C:\Users\James Jarvis\Desktop\planetPrecision\rdTap\rdTap.lst
ROM used: 14392 bytes (44%)
Largest free fragment is 18372
RAM used: 2426 (67%) at main() level
2463 (68%) worst case
Stack used: 8 locations (5 in main + 3 for interrupts)
Stack size: 31
*
0000: GOTO 3650
*
0008: MOVWF 04
000A: MOVFF FD8,05
000E: MOVFF FE0,06
0012: MOVLB 0
0014: MOVFF FE9,0C
0018: MOVFF FEA,07
001C: MOVFF FE1,08
0020: MOVFF FE2,09
0024: MOVFF FD9,0A
0028: MOVFF FDA,0B
002C: MOVFF FF3,12
0030: MOVFF FF4,13
0034: MOVFF FFA,14
0038: MOVFF FF5,15
003C: MOVFF FF6,16
0040: MOVFF FF7,17
0044: MOVFF 00,0E
0048: MOVFF 01,0F
004C: MOVFF 02,10
0050: MOVFF 03,11
0054: BTFSS F9D.1
0056: GOTO 0060
005A: BTFSC F9E.1
005C: GOTO 0304
0060: BTFSS F9D.5
0062: GOTO 006C
0066: BTFSC F9E.5
0068: GOTO 0378
006C: BTFSS FA3.5
006E: GOTO 0078
0072: BTFSC FA4.5
0074: GOTO 04E2
0078: BTFSS FB6.7
007A: GOTO 0084
007E: BTFSC FB7.7
0080: GOTO 046C
0084: MOVFF 0E,00
0088: MOVFF 0F,01
008C: MOVFF 10,02
0090: MOVFF 11,03
0094: MOVFF 0C,FE9
0098: MOVFF 07,FEA
009C: BSF 07.7
009E: MOVFF 08,FE1
00A2: MOVFF 09,FE2
00A6: MOVFF 0A,FD9
00AA: MOVFF 0B,FDA
00AE: MOVFF 12,FF3
00B2: MOVFF 13,FF4
00B6: MOVFF 14,FFA
00BA: MOVFF 15,FF5
00BE: MOVFF 16,FF6
00C2: MOVFF 17,FF7
00C6: MOVF 04,W
00C8: MOVFF 06,FE0
00CC: MOVFF 05,FD8
00D0: RETFIE 0
.................... #define DEBUG_ASCII 0
.................... #define DEBUG_SBD 0
.................... #define MCP3208_ENABLED 0
.................... #define STARTUP_BLINKS 150
....................
....................
.................... #include "rdTap.h"
.................... #include <18F25K80.h>
.................... //////////// Standard Header file for the PIC18F25K80 device ////////////////
.................... ///////////////////////////////////////////////////////////////////////////
.................... //// (C) Copyright 1996, 2020 Custom Computer Services ////
.................... //// This source code may only be used by licensed users of the CCS C ////
.................... //// compiler. This source code may only be distributed to other ////
.................... //// licensed users of the CCS C compiler. No other use, reproduction ////
.................... //// or distribution is permitted without written permission. ////
.................... //// Derivative programs created using this software in object code ////
.................... //// form are not restricted in any way. ////
.................... ///////////////////////////////////////////////////////////////////////////
.................... #device PIC18F25K80
00D2: CLRF FF7
00D4: ADDLW E2
00D6: MOVWF FF6
00D8: MOVLW 00
00DA: ADDWFC FF7,F
00DC: TBLRD*+
00DE: MOVF FF5,W
00E0: RETURN 0
00E2: DATA 00,C1
00E4: DATA 81,40
00E6: DATA 01,C0
00E8: DATA 80,41
00EA: DATA 01,C0
00EC: DATA 80,41
00EE: DATA 00,C1
00F0: DATA 81,40
00F2: DATA 01,C0
00F4: DATA 80,41
00F6: DATA 00,C1
00F8: DATA 81,40
00FA: DATA 00,C1
00FC: DATA 81,40
00FE: DATA 01,C0
0100: DATA 80,41
0102: DATA 01,C0
0104: DATA 80,41
0106: DATA 00,C1
0108: DATA 81,40
010A: DATA 00,C1
010C: DATA 81,40
010E: DATA 01,C0
0110: DATA 80,41
0112: DATA 00,C1
0114: DATA 81,40
0116: DATA 01,C0
0118: DATA 80,41
011A: DATA 01,C0
011C: DATA 80,41
011E: DATA 00,C1
0120: DATA 81,40
0122: DATA 01,C0
0124: DATA 80,41
0126: DATA 00,C1
0128: DATA 81,40
012A: DATA 00,C1
012C: DATA 81,40
012E: DATA 01,C0
0130: DATA 80,41
0132: DATA 00,C1
0134: DATA 81,40
0136: DATA 01,C0
0138: DATA 80,41
013A: DATA 01,C0
013C: DATA 80,41
013E: DATA 00,C1
0140: DATA 81,40
0142: DATA 00,C1
0144: DATA 81,40
0146: DATA 01,C0
0148: DATA 80,41
014A: DATA 01,C0
014C: DATA 80,41
014E: DATA 00,C1
0150: DATA 81,40
0152: DATA 01,C0
0154: DATA 80,41
0156: DATA 00,C1
0158: DATA 81,40
015A: DATA 00,C1
015C: DATA 81,40
015E: DATA 01,C0
0160: DATA 80,41
0162: DATA 01,C0
0164: DATA 80,41
0166: DATA 00,C1
0168: DATA 81,40
016A: DATA 00,C1
016C: DATA 81,40
016E: DATA 01,C0
0170: DATA 80,41
0172: DATA 00,C1
0174: DATA 81,40
0176: DATA 01,C0
0178: DATA 80,41
017A: DATA 01,C0
017C: DATA 80,41
017E: DATA 00,C1
0180: DATA 81,40
0182: DATA 00,C1
0184: DATA 81,40
0186: DATA 01,C0
0188: DATA 80,41
018A: DATA 01,C0
018C: DATA 80,41
018E: DATA 00,C1
0190: DATA 81,40
0192: DATA 01,C0
0194: DATA 80,41
0196: DATA 00,C1
0198: DATA 81,40
019A: DATA 00,C1
019C: DATA 81,40
019E: DATA 01,C0
01A0: DATA 80,41
01A2: DATA 00,C1
01A4: DATA 81,40
01A6: DATA 01,C0
01A8: DATA 80,41
01AA: DATA 01,C0
01AC: DATA 80,41
01AE: DATA 00,C1
01B0: DATA 81,40
01B2: DATA 01,C0
01B4: DATA 80,41
01B6: DATA 00,C1
01B8: DATA 81,40
01BA: DATA 00,C1
01BC: DATA 81,40
01BE: DATA 01,C0
01C0: DATA 80,41
01C2: DATA 01,C0
01C4: DATA 80,41
01C6: DATA 00,C1
01C8: DATA 81,40
01CA: DATA 00,C1
01CC: DATA 81,40
01CE: DATA 01,C0
01D0: DATA 80,41
01D2: DATA 00,C1
01D4: DATA 81,40
01D6: DATA 01,C0
01D8: DATA 80,41
01DA: DATA 01,C0
01DC: DATA 80,41
01DE: DATA 00,C1
01E0: DATA 81,40
01E2: CLRF FF7
01E4: ADDLW F2
01E6: MOVWF FF6
01E8: MOVLW 01
01EA: ADDWFC FF7,F
01EC: TBLRD*+
01EE: MOVF FF5,W
01F0: RETURN 0
01F2: DATA 00,C0
01F4: DATA C1,01
01F6: DATA C3,03
01F8: DATA 02,C2
01FA: DATA C6,06
01FC: DATA 07,C7
01FE: DATA 05,C5
0200: DATA C4,04
0202: DATA CC,0C
0204: DATA 0D,CD
0206: DATA 0F,CF
0208: DATA CE,0E
020A: DATA 0A,CA
020C: DATA CB,0B
020E: DATA C9,09
0210: DATA 08,C8
0212: DATA D8,18
0214: DATA 19,D9
0216: DATA 1B,DB
0218: DATA DA,1A
021A: DATA 1E,DE
021C: DATA DF,1F
021E: DATA DD,1D
0220: DATA 1C,DC
0222: DATA 14,D4
0224: DATA D5,15
0226: DATA D7,17
0228: DATA 16,D6
022A: DATA D2,12
022C: DATA 13,D3
022E: DATA 11,D1
0230: DATA D0,10
0232: DATA F0,30
0234: DATA 31,F1
0236: DATA 33,F3
0238: DATA F2,32
023A: DATA 36,F6
023C: DATA F7,37
023E: DATA F5,35
0240: DATA 34,F4
0242: DATA 3C,FC
0244: DATA FD,3D
0246: DATA FF,3F
0248: DATA 3E,FE
024A: DATA FA,3A
024C: DATA 3B,FB
024E: DATA 39,F9
0250: DATA F8,38
0252: DATA 28,E8
0254: DATA E9,29
0256: DATA EB,2B
0258: DATA 2A,EA
025A: DATA EE,2E
025C: DATA 2F,EF
025E: DATA 2D,ED
0260: DATA EC,2C
0262: DATA E4,24
0264: DATA 25,E5
0266: DATA 27,E7
0268: DATA E6,26
026A: DATA 22,E2
026C: DATA E3,23
026E: DATA E1,21
0270: DATA 20,E0
0272: DATA A0,60
0274: DATA 61,A1
0276: DATA 63,A3
0278: DATA A2,62
027A: DATA 66,A6
027C: DATA A7,67
027E: DATA A5,65
0280: DATA 64,A4
0282: DATA 6C,AC
0284: DATA AD,6D
0286: DATA AF,6F
0288: DATA 6E,AE
028A: DATA AA,6A
028C: DATA 6B,AB
028E: DATA 69,A9
0290: DATA A8,68
0292: DATA 78,B8
0294: DATA B9,79
0296: DATA BB,7B
0298: DATA 7A,BA
029A: DATA BE,7E
029C: DATA 7F,BF
029E: DATA 7D,BD
02A0: DATA BC,7C
02A2: DATA B4,74
02A4: DATA 75,B5
02A6: DATA 77,B7
02A8: DATA B6,76
02AA: DATA 72,B2
02AC: DATA B3,73
02AE: DATA B1,71
02B0: DATA 70,B0
02B2: DATA 50,90
02B4: DATA 91,51
02B6: DATA 93,53
02B8: DATA 52,92
02BA: DATA 96,56
02BC: DATA 57,97
02BE: DATA 55,95
02C0: DATA 94,54
02C2: DATA 9C,5C
02C4: DATA 5D,9D
02C6: DATA 5F,9F
02C8: DATA 9E,5E
02CA: DATA 5A,9A
02CC: DATA 9B,5B
02CE: DATA 99,59
02D0: DATA 58,98
02D2: DATA 88,48
02D4: DATA 49,89
02D6: DATA 4B,8B
02D8: DATA 8A,4A
02DA: DATA 4E,8E
02DC: DATA 8F,4F
02DE: DATA 8D,4D
02E0: DATA 4C,8C
02E2: DATA 44,84
02E4: DATA 85,45
02E6: DATA 87,47
02E8: DATA 46,86
02EA: DATA 82,42
02EC: DATA 43,83
02EE: DATA 41,81
02F0: DATA 80,40
*
03E2: DATA 41,54
03E4: DATA 45,30
03E6: DATA 0D,00
03E8: DATA 41,54
03EA: DATA 26,4B
03EC: DATA 30,0D
03EE: DATA 00,00
03F0: DATA 41,54
03F2: DATA 2B,53
03F4: DATA 42,44
03F6: DATA 4D,54
03F8: DATA 41,3D
03FA: DATA 31,0D
03FC: DATA 00,00
03FE: DATA 41,54
0400: DATA 2B,43
0402: DATA 52,49
0404: DATA 53,0D
0406: DATA 00,00
0408: DATA 41,54
040A: DATA 45,30
040C: DATA 0D,00
040E: DATA 41,54
0410: DATA 26,4B
0412: DATA 30,0D
0414: DATA 00,00
0416: DATA 41,54
0418: DATA 2B,53
041A: DATA 42,44
041C: DATA 4D,54
041E: DATA 41,3D
0420: DATA 31,0D
0422: DATA 00,00
0424: DATA 41,54
0426: DATA 2B,53
0428: DATA 42,44
042A: DATA 57,42
042C: DATA 3D,25
042E: DATA 6C,75
0430: DATA 0D,00
0432: DATA 41,54
0434: DATA 2B,53
0436: DATA 42,44
0438: DATA 49,58
043A: DATA 0D,00
043C: DATA 41,54
043E: DATA 2B,53
0440: DATA 42,44
0442: DATA 44,30
0444: DATA 0D,00
0446: DATA 41,54
0448: DATA 45,30
044A: DATA 0D,00
044C: DATA 41,54
044E: DATA 26,4B
0450: DATA 30,0D
0452: DATA 00,00
0454: DATA 41,54
0456: DATA 2B,53
0458: DATA 42,44
045A: DATA 4D,54
045C: DATA 41,3D
045E: DATA 31,0D
0460: DATA 00,00
0462: DATA 41,54
0464: DATA 2B,53
0466: DATA 42,44
0468: DATA 52,42
046A: DATA 0D,00
*
084C: MOVLB 9
084E: MOVF x94,W
0850: MULWF x96
0852: MOVFF FF3,01
0856: MOVFF FF4,00
085A: MULWF x97
085C: MOVF FF3,W
085E: ADDWF 00,F
0860: MOVF x95,W
0862: MULWF x96
0864: MOVF FF3,W
0866: ADDWFC 00,W
0868: MOVWF 02
086A: MOVLB 0
086C: RETURN 0
*
0F74: TBLRD*+
0F76: MOVF FF5,F
0F78: BZ 0F92
0F7A: MOVFF FF6,97E
0F7E: MOVFF FF7,97F
0F82: MOVFF FF5,987
0F86: RCALL 0F64
0F88: MOVFF 97E,FF6
0F8C: MOVFF 97F,FF7
0F90: BRA 0F74
0F92: RETURN 0
*
1206: TBLRD*+
1208: MOVFF FF6,97F
120C: MOVFF FF7,980
1210: MOVFF FF5,987
1214: RCALL 0F64
1216: MOVFF 97F,FF6
121A: MOVFF 980,FF7
121E: MOVLB 9
1220: DECFSZ x7E,F
1222: BRA 1226
1224: BRA 122A
1226: MOVLB 0
1228: BRA 1206
122A: MOVLB 0
122C: GOTO 14AC (RETURN)
1230: MOVFF FEA,986
1234: MOVFF FE9,985
1238: MOVLB 9
123A: SWAPF x7F,W
123C: IORLW F0
123E: MOVWF x81
1240: ADDWF x81,F
1242: ADDLW E2
1244: MOVWF x82
1246: ADDLW 32
1248: MOVWF x84
124A: MOVF x7F,W
124C: ANDLW 0F
124E: ADDWF x82,F
1250: ADDWF x82,F
1252: ADDWF x84,F
1254: ADDLW E9
1256: MOVWF x83
1258: ADDWF x83,F
125A: ADDWF x83,F
125C: SWAPF x7E,W
125E: ANDLW 0F
1260: ADDWF x83,F
1262: ADDWF x84,F
1264: RLCF x83,F
1266: RLCF x84,F
1268: COMF x84,F
126A: RLCF x84,F
126C: MOVF x7E,W
126E: ANDLW 0F
1270: ADDWF x84,F
1272: RLCF x81,F
1274: MOVLW 07
1276: MOVWF x80
1278: MOVLW 0A
127A: DECF x83,F
127C: ADDWF x84,F
127E: BNC 127A
1280: DECF x82,F
1282: ADDWF x83,F
1284: BNC 1280
1286: DECF x81,F
1288: ADDWF x82,F
128A: BNC 1286
128C: DECF x80,F
128E: ADDWF x81,F
1290: BNC 128C
1292: MOVLW 09
1294: MOVWF FEA
1296: MOVLW 80
1298: MOVWF FE9
129A: MOVLW 07
129C: ANDWF x85,W
129E: BCF x85.6
12A0: ADDWF FE9,F
12A2: MOVLW 00
12A4: ADDWFC FEA,F
12A6: MOVF FE9,W
12A8: SUBLW 84
12AA: BNZ 12B4
12AC: MOVF FEA,W
12AE: SUBLW 09
12B0: BNZ 12B4
12B2: BSF x85.6
12B4: MOVF FEF,W
12B6: MOVWF 00
12B8: BNZ 12CA
12BA: BTFSC x85.6
12BC: BRA 12CA
12BE: BTFSC x85.4
12C0: BRA 12EC
12C2: BTFSC x85.3
12C4: BRA 12CA
12C6: MOVLW 20
12C8: BRA 12D0
12CA: BSF x85.3
12CC: BCF x85.4
12CE: MOVLW 30
12D0: ADDWF 00,F
12D2: MOVFF FEA,97F
12D6: MOVFF FE9,97E
12DA: MOVFF 00,987
12DE: MOVLB 0
12E0: RCALL 0F64
12E2: MOVFF 97F,FEA
12E6: MOVFF 97E,FE9
12EA: MOVLB 9
12EC: MOVF FEE,W
12EE: BTFSS x85.6
12F0: BRA 12A6
12F2: MOVLB 0
12F4: GOTO 14BA (RETURN)
*
291C: ADDWF FE8,W
291E: CLRF FF7
2920: RLCF FF7,F
2922: ADDLW 37
2924: MOVWF FF6
2926: MOVLW 29
2928: ADDWFC FF7,F
292A: TBLRD*-
292C: MOVF FF5,W
292E: MOVWF FFA
2930: TBLRD*
2932: MOVF FF5,W
2934: MOVWF FF9
2936: DATA 82,25
2938: DATA B4,25
293A: DATA F6,25
293C: DATA 34,26
293E: DATA 72,26
2940: DATA 06,27
2942: DATA 9A,27
2944: DATA DC,27
*
2CBA: ADDWF FE8,W
2CBC: CLRF FF7
2CBE: RLCF FF7,F
2CC0: ADDLW D5
2CC2: MOVWF FF6
2CC4: MOVLW 2C
2CC6: ADDWFC FF7,F
2CC8: TBLRD*-
2CCA: MOVF FF5,W
2CCC: MOVWF FFA
2CCE: TBLRD*
2CD0: MOVF FF5,W
2CD2: MOVWF FF9
2CD4: DATA 10,2A
2CD6: DATA 40,2A
2CD8: DATA 82,2A
2CDA: DATA BE,2A
2CDC: DATA FA,2A
2CDE: DATA 06,2B
2CE0: DATA 56,2B
2CE2: DATA 98,2B
....................
.................... #list
....................
.................... #device ADC=12
.................... #device *=16
....................
.................... #fuses INTRC_IO
.................... #fuses NOFCMEN
.................... #fuses NOIESO
.................... #fuses NOPUT
.................... #fuses BROWNOUT
.................... #fuses BORV30
.................... //#fuses WDT512
.................... #fuses WDT1024
.................... #fuses NOMCLR
.................... #fuses STVREN
.................... #fuses SOSC_DIG
.................... #fuses NOXINST
.................... #fuses NODEBUG
.................... #fuses NOPROTECT
....................
....................
.................... #byte ANCON0=GETENV("SFR:ancon0")
.................... #byte ANCON1=GETENV("SFR:ancon1")
....................
....................
....................
.................... #include <stdlib.h>
.................... ///////////////////////////////////////////////////////////////////////////
.................... //// (C) Copyright 1996,2007 Custom Computer Services ////
.................... //// This source code may only be used by licensed users of the CCS C ////
.................... //// compiler. This source code may only be distributed to other ////
.................... //// licensed users of the CCS C compiler. No other use, reproduction ////
.................... //// or distribution is permitted without written permission. ////
.................... //// Derivative programs created using this software in object code ////
.................... //// form are not restricted in any way. ////
.................... ///////////////////////////////////////////////////////////////////////////
....................
....................
.................... #ifndef _STDLIB
.................... #define _STDLIB
....................
.................... //---------------------------------------------------------------------------
.................... // Definitions and types
.................... //---------------------------------------------------------------------------
....................
.................... #ifndef RAND_MAX
.................... #define RAND_MAX 32767 // The value of which is the maximum value
.................... // ... returned by the rand function
.................... #endif
....................
....................
.................... #IF (sizeof(int16*)>1)
.................... #DEFINE LONG_POINTERS 1
.................... #ELSE
.................... #DEFINE LONG_POINTERS 0
.................... #ENDIF
....................
.................... typedef struct {
.................... signed int quot;
.................... signed int rem;
.................... } div_t;
....................
.................... typedef struct {
.................... signed long quot;
.................... signed long rem;
.................... } ldiv_t;
....................
.................... #include <stddef.h>
.................... ///////////////////////////////////////////////////////////////////////////
.................... //// (C) Copyright 1996,2003 Custom Computer Services ////
.................... //// This source code may only be used by licensed users of the CCS C ////
.................... //// compiler. This source code may only be distributed to other ////
.................... //// licensed users of the CCS C compiler. No other use, reproduction ////
.................... //// or distribution is permitted without written permission. ////
.................... //// Derivative programs created using this software in object code ////
.................... //// form are not restricted in any way. ////
.................... ///////////////////////////////////////////////////////////////////////////
....................
.................... #ifndef _STDDEF
....................
.................... #define _STDDEF
....................
.................... #if sizeof(unsigned int8 *)==1
.................... #define ptrdiff_t unsigned int8
.................... #else
.................... #define ptrdiff_t unsigned int16
.................... #endif
....................
.................... #if defined(__PCB__) || defined(__PCM__)
.................... #define size_t unsigned int8
.................... #else
.................... #define size_t unsigned int16
.................... #endif
.................... #define wchar_t unsigned char
.................... #define NULL 0
....................
.................... #define offsetof(s,f) (offsetofbit(s,f)/8)
....................
.................... #endif
....................
....................
.................... //---------------------------------------------------------------------------
.................... // String conversion functions
.................... //---------------------------------------------------------------------------
....................
.................... /* Standard template: signed int atoi(char * s)
.................... * converts the initial portion of the string s to a signed int
.................... * returns the converted value if any, 0 otherwise
.................... */
.................... signed int atoi(char *s);
....................
.................... /* Syntax: signed int32 atoi32(char * s)
.................... converts the initial portion of the string s to a signed int32
.................... returns the converted value if any, 0 otherwise*/
.................... #if (sizeof(long)==4)
.................... #define atoi32(s) atol(s)
.................... #else
.................... signed int32 atoi32(char *s);
.................... #endif
....................
.................... #if defined(__PCD__)
.................... // The following functions only work on the 24 bit compiler
.................... // for the 30F, 33F, 24F and 24H parts
.................... /* Syntax: signed int48 atoi48(char * s)
.................... converts the initial portion of the string s to a signed int48
.................... returns the converted value if any, 0 otherwise*/
....................
.................... signed int48 atoi48(char *s);
....................
.................... /* Syntax: signed int64 atoi64(char * s)
.................... converts the initial portion of the string s to a signed int64
.................... returns the converted value if any, 0 otherwise*/
.................... signed int64 atoi64(char *s);
.................... #endif
....................
.................... /* Syntax: char * itoa(signed int32 num, int8 base, char * s)
.................... converts the signed int32 to a string and
.................... returns the converted value if any, 0 otherwise*/
.................... char * itoa(signed int32 num, unsigned int base, char * s);
....................
.................... /* Standard template: signed int16 atol(char * s)
.................... * converts the initial portion of the string s to a signed int16
.................... * returns the converted value if any, 0 otherwise
.................... */
.................... signed long atol(char *s);
....................
.................... /* Standard template: int16 strtoul(char * s,char *endptr,signed int base)
.................... * converts the initial portion of the string s, represented as an
.................... * integral value of radix base to a signed long.
.................... * Returns the converted value if any, 0 otherwise
.................... * the final string is returned in the endptr, if endptr is not null
.................... */
.................... signed long strtol(char *s,char *endptr, signed int base);
....................
.................... /* Standard template: int16 strtoul(char * s,char *endptr,signed int base)
.................... * converts the initial portion of the string s, represented as an
.................... * integral value of radix base to a unsigned long.
.................... * returns the converted value if any, 0 otherwise
.................... * the final string is returned in the endptr, if endptr is not null
.................... */
.................... unsigned long strtoul(char *s,char *endptr, signed int base);
....................
.................... /* Standart template: float strtof(char * s,char *endptr)
.................... float48 strtof48(char *s,char *endptr);
.................... float64 strtod(char *s,char *endptr);
.................... * converts the initial portion of the string s to a float32, float48 or float64,
.................... * returns the converted value if any, 0 otherwise
.................... * the final string is returned in the endptr, if endptr is not null
.................... */
.................... float strtof(char *s,char **endptr);
.................... #if defined(__PCD__)
.................... float48 strtof48(char *s,char **endptr);
.................... float64 strtod(char *s,char **endptr);
.................... #else
.................... //provided for compatibility
.................... #define strtof48(s, e) strtof(s, e)
.................... #define strtod(s, e) strtof(s, e)
.................... #endif
....................
.................... /* Standard template: float32 atof(char * s)
.................... * converts the initial portion of the string s to a float.
.................... * returns the converted value if any, 0 otherwise
.................... */
.................... #define atof(s) strtof(s, (char*)0)
....................
.................... #if defined(__PCD__)
.................... // The following functions only work on the 24 bit compiler
.................... // for the 30F, 33F, 24F and 24H parts
....................
.................... /* Standard template: float48 atof48(char * s)
.................... * converts the initial portion of the string s to a float.
.................... * returns the converted value if any, 0 otherwise
.................... */
.................... #define atof48(s) strtof48(s, 0)
....................
.................... /* Standard template: float64 atof64(char * s)
.................... * converts the initial portion of the string s to a float.
.................... * returns the converted value if any, 0 otherwise
.................... */
.................... #define atof64(s) strtod(s, 0)
.................... #endif
....................
.................... /* Standard template: float32 atoe(char * s)
.................... * converts the initial portion of the string s to a float.
.................... * returns the converted value if any, 0 otherwise
.................... * also handles E format numbers
.................... */
.................... #if !defined(__PCD__)
.................... float atoe(char * s);
.................... #endif
....................
.................... #if defined(__PCD__)
.................... float32 atoe(char * s);
.................... #endif
....................
.................... //---------------------------------------------------------------------------
.................... // Pseudo-random sequence generation functions
.................... //---------------------------------------------------------------------------
....................
.................... /* The rand function computes a sequence of pseudo-random integers in
.................... * the range 0 to RAND_MAX
.................... *
.................... * Parameters:
.................... * (none)
.................... *
.................... * Returns:
.................... * The pseudo-random integer
.................... */
.................... unsigned int16 rand(void);
....................
.................... /* The srand function uses the argument as a seed for a new sequence of
.................... * pseudo-random numbers to be returned by subsequent calls to rand.
.................... *
.................... * Parameters:
.................... * [in] seed: The seed value to start from. You might need to pass
.................... *
.................... * Returns:
.................... * (none)
.................... *
.................... * Remarks
.................... * The srand function sets the starting point for generating
.................... * a series of pseudorandom integers. To reinitialize the
.................... * generator, use 1 as the seed argument. Any other value for
.................... * seed sets the generator to a random starting point. rand
.................... * retrieves the pseudorandom numbers that are generated.
.................... * Calling rand before any call to srand generates the same
.................... * sequence as calling srand with seed passed as 1.
.................... * Usually, you need to pass a time here from outer source
.................... * so that the numbers will be different every time you run.
.................... */
.................... void srand(unsigned int32 seed);
....................
.................... //---------------------------------------------------------------------------
.................... // Memory management functions
.................... //---------------------------------------------------------------------------
....................
.................... // Comming soon
....................
.................... //---------------------------------------------------------------------------
.................... // Communication with the environment
.................... //---------------------------------------------------------------------------
....................
.................... /* The function returns 0 always
.................... */
.................... signed int8 system(char *string);
....................
.................... //---------------------------------------------------------------------------
.................... // Searching and sorting utilities
.................... //---------------------------------------------------------------------------
....................
.................... /* Performs a binary search of a sorted array..
.................... *
.................... * Parameters:
.................... * [in] key: Object to search for
.................... * [in] base: Pointer to base of search data
.................... * [in] num: Number of elements
.................... * [in] width: Width of elements
.................... * [in] compare: Function that compares two elements
.................... *
.................... * Returns:
.................... * bsearch returns a pointer to an occurrence of key in the array pointed
.................... * to by base. If key is not found, the function returns NULL. If the
.................... * array is not in order or contains duplicate records with identical keys,
.................... * the result is unpredictable.
.................... */
.................... //void *bsearch(const void *key, const void *base, size_t num, size_t width,
.................... // int (*compare)(const void *, const void *));
....................
.................... /* Performs the shell-metzner sort (not the quick sort algorithm). The contents
.................... * of the array are sorted into ascending order according to a comparison
.................... * function pointed to by compar.
.................... *
.................... * Parameters:
.................... * [in] base: Pointer to base of search data
.................... * [in] num: Number of elements
.................... * [in] width: Width of elements
.................... * [in] compare: Function that compares two elements
.................... *
.................... * Returns:
.................... * (none)
.................... */
.................... //void *qsort(const void *base, size_t num, size_t width,
.................... // int (*compare)(const void *, const void *));
....................
.................... //---------------------------------------------------------------------------
.................... // Integer arithmetic functions
.................... //---------------------------------------------------------------------------
....................
.................... #define labs abs
....................
.................... div_t div(signed int numer, signed int denom);
.................... ldiv_t ldiv(signed long numer, signed long denom);
....................
.................... //---------------------------------------------------------------------------
.................... // Multibyte character functions
.................... //---------------------------------------------------------------------------
....................
.................... // Not supported
....................
.................... //---------------------------------------------------------------------------
.................... // Multibyte string functions
.................... //---------------------------------------------------------------------------
....................
.................... // Not supported
....................
....................
.................... //---------------------------------------------------------------------------
.................... // Internal implementation
.................... //---------------------------------------------------------------------------
....................
.................... #include <stddef.h>
.................... ///////////////////////////////////////////////////////////////////////////
.................... //// (C) Copyright 1996,2003 Custom Computer Services ////
.................... //// This source code may only be used by licensed users of the CCS C ////
.................... //// compiler. This source code may only be distributed to other ////
.................... //// licensed users of the CCS C compiler. No other use, reproduction ////
.................... //// or distribution is permitted without written permission. ////
.................... //// Derivative programs created using this software in object code ////
.................... //// form are not restricted in any way. ////
.................... ///////////////////////////////////////////////////////////////////////////
....................
.................... #ifndef _STDDEF
....................
.................... #define _STDDEF
....................
.................... #if sizeof(unsigned int8 *)==1
.................... #define ptrdiff_t unsigned int8
.................... #else
.................... #define ptrdiff_t unsigned int16
.................... #endif
....................
.................... #if defined(__PCB__) || defined(__PCM__)
.................... #define size_t unsigned int8
.................... #else
.................... #define size_t unsigned int16
.................... #endif
.................... #define wchar_t unsigned char
.................... #define NULL 0
....................
.................... #define offsetof(s,f) (offsetofbit(s,f)/8)
....................
.................... #endif
....................
.................... #include <string.h>
.................... ////////////////////////////////////////////////////////////////////////////
.................... //// (C) Copyright 1996,2008 Custom Computer Services ////
.................... //// This source code may only be used by licensed users of the CCS C ////
.................... //// compiler. This source code may only be distributed to other ////
.................... //// licensed users of the CCS C compiler. No other use, reproduction ////
.................... //// or distribution is permitted without written permission. ////
.................... //// Derivative programs created using this software in object code ////
.................... //// form are not restricted in any way. ////
.................... ////////////////////////////////////////////////////////////////////////////
....................
.................... #ifndef _STRING
.................... #define _STRING
.................... #include <stddef.h>
.................... ///////////////////////////////////////////////////////////////////////////
.................... //// (C) Copyright 1996,2003 Custom Computer Services ////
.................... //// This source code may only be used by licensed users of the CCS C ////
.................... //// compiler. This source code may only be distributed to other ////
.................... //// licensed users of the CCS C compiler. No other use, reproduction ////
.................... //// or distribution is permitted without written permission. ////
.................... //// Derivative programs created using this software in object code ////
.................... //// form are not restricted in any way. ////
.................... ///////////////////////////////////////////////////////////////////////////
....................