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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
|
gpasm-0.13.4 beta serial1.asm 6-13-2008 14:34:00 PAGE 1
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
00001 ;--------------------------------------------------------
00002 ; File Created by SDCC : free open source ANSI-C Compiler
00003 ; Version 2.7.4 #4943 (Oct 27 2007) (UNIX)
00004 ; This file was generated Fri Jun 13 14:34:00 2008
00005 ;--------------------------------------------------------
00006 ; PIC port for the 14-bit core
00007 ;--------------------------------------------------------
00008 ; .module serial1
00009 list p=16f648a
00010 radix dec
00011 include "p16f648a.inc"
00001 LIST
00002 ; P16F648A.INC Standard Header File, Version 1.00 Microchip Technology, Inc.
00264 LIST
00012 ;--------------------------------------------------------
00013 ; external declarations
00014 ;--------------------------------------------------------
00015 extern _delay_10us
00016 extern _clearwdt
00017 extern _CCP1CON_bits
00018 extern _CMCON_bits
00019 extern _EECON1_bits
00020 extern _INTCON_bits
00021 extern _OPTION_REG_bits
00022 extern _PCON_bits
00023 extern _PIE1_bits
00024 extern _PIR1_bits
00025 extern _PORTA_bits
00026 extern _PORTB_bits
00027 extern _RCSTA_bits
00028 extern _STATUS_bits
00029 extern _T1CON_bits
00030 extern _T2CON_bits
00031 extern _TRISA_bits
00032 extern _TRISB_bits
00033 extern _TXSTA_bits
00034 extern _VRCON_bits
00035 extern _buffer
00036 extern _transmitBuffer
00037 extern _sendPacket
00038 extern _deviceAddress
00039 extern _INDF
00040 extern _TMR0
00041 extern _PCL
00042 extern _STATUS
00043 extern _FSR
00044 extern _PORTA
00045 extern _PORTB
00046 extern _PCLATH
00047 extern _INTCON
00048 extern _PIR1
00049 extern _TMR1L
00050 extern _TMR1H
00051 extern _T1CON
gpasm-0.13.4 beta serial1.asm 6-13-2008 14:34:00 PAGE 2
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
00052 extern _TMR2
00053 extern _T2CON
00054 extern _CCPR1L
00055 extern _CCPR1H
00056 extern _CCP1CON
00057 extern _RCSTA
00058 extern _TXREG
00059 extern _RCREG
00060 extern _CMCON
00061 extern _OPTION_REG
00062 extern _TRISA
00063 extern _TRISB
00064 extern _PIE1
00065 extern _PCON
00066 extern _PR2
00067 extern _TXSTA
00068 extern _SPBRG
00069 extern _EEDATA
00070 extern _EEADR
00071 extern _EECON1
00072 extern _EECON2
00073 extern _VRCON
00074
00075 extern PSAVE
00076 extern SSAVE
00077 extern WSAVE
00078 extern STK12
00079 extern STK11
00080 extern STK10
00081 extern STK09
00082 extern STK08
00083 extern STK07
00084 extern STK06
00085 extern STK05
00086 extern STK04
00087 extern STK03
00088 extern STK02
00089 extern STK01
00090 extern STK00
00091 ;--------------------------------------------------------
00092 ; global declarations
00093 ;--------------------------------------------------------
00094 global _serialInterruptHandler
00095 global _endMessage
00096 global _endMessageISR
00097 global _packetReady
00098 global _sendReply
00099 global _sendMessage
00100 global _sendMessageISR
00101 global _releaseLock
00102 global _sendDataByteISR
00103 global _sendDataByte
00104 global _uartTransmit
00105 global _uartNotifyReceive
gpasm-0.13.4 beta serial1.asm 6-13-2008 14:34:00 PAGE 3
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
00106 global _serial_init
00107 global _setFlash
00108 global _LEDon
00109 global _flashLED
00110 global _computeCRC
00111 global _uartReceiveError
00112 global _serialStatus
00113
00114 ;--------------------------------------------------------
00115 ; global definitions
00116 ;--------------------------------------------------------
00117 UD_serial1_0 udata
00118 _serialStatus res 1
00119
00120 ;--------------------------------------------------------
00121 ; absolute symbol definitions
00122 ;--------------------------------------------------------
00123 ;--------------------------------------------------------
00124 ; compiler-defined variables
00125 ;--------------------------------------------------------
00126 UDL_serial1_0 udata
00127 r0x1017 res 1
00128 r0x1018 res 1
00129 r0x1014 res 1
00130 r0x1015 res 1
00131 r0x1016 res 1
00132 r0x1019 res 1
00133 r0x101A res 1
00134 r0x101B res 1
00135 r0x1025 res 1
00136 r0x1026 res 1
00137 r0x1027 res 1
00138 r0x1028 res 1
00139 r0x1022 res 1
00140 r0x1023 res 1
00141 r0x1021 res 1
00142 r0x1020 res 1
00143 r0x101C res 1
00144 r0x101D res 1
00145 r0x101E res 1
00146 r0x1012 res 1
00147 r0x1013 res 1
00148 _flash_count res 1
00149 _flash res 1
00150 _flashOFF res 1
00151 _flashON res 1
00152 _transmitBufferHead res 1
00153 _transmitBufferTail res 1
00154 _crc res 1
00155 _in_hdb2 res 1
00156 _in_hdb1 res 1
00157 _packetLength res 1
00158 _sourceAddress res 1
00159 _bufferIndex res 1
gpasm-0.13.4 beta serial1.asm 6-13-2008 14:34:00 PAGE 4
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
00160 _receivedSourceAddress res 1
00161 _sendPacketLength res 1
00162 _sendPacketDestination res 1
00163 ;--------------------------------------------------------
00164 ; initialized data
00165 ;--------------------------------------------------------
00166
00167 ID_serial1_0 idata
0000 00168 _uartState
00169 db 0x30
00170
00171 ;--------------------------------------------------------
00172 ; overlayable items in internal ram
00173 ;--------------------------------------------------------
00174 ; udata_ovr
00175 ;--------------------------------------------------------
00176 ; code
00177 ;--------------------------------------------------------
00178 code_serial1 code
00179 ;***
00180 ; pBlock Stats: dbName = C
00181 ;***
00182 ;entry: _serialInterruptHandler ;Function start
00183 ; 2 exit points
00184 ;has an exit
00185 ;functions called:
00186 ; _uartNotifyReceive
00187 ; _uartNotifyReceive
00188 ;2 compiler assigned registers:
00189 ; r0x1012
00190 ; r0x1013
00191 ;; Starting pCode block
0000 00192 _serialInterruptHandler ;Function start
00193 ; 2 exit points
00194 ; .line 905; "serial1.c" if (TXIF && TXIE) {
0000 0000 0000 00195 BANKSEL _PIR1_bits
0002 1E00 00196 BTFSS _PIR1_bits,4
0003 2800 00197 GOTO _00339_DS_
0004 0000 0000 00198 BANKSEL _PIE1_bits
0006 1E00 00199 BTFSS _PIE1_bits,4
0007 2800 00200 GOTO _00339_DS_
00201 ; .line 906; "serial1.c" if (transmitBufferHead == transmitBufferTail) {
0008 0000 0000 00202 BANKSEL _transmitBufferTail
000A 0800 00203 MOVF _transmitBufferTail,W
000B 0000 0000 00204 BANKSEL _transmitBufferHead
000D 0600 00205 XORWF _transmitBufferHead,W
000E 1D03 00206 BTFSS STATUS,2
000F 2800 00207 GOTO _00336_DS_
00208 ; .line 908; "serial1.c" if (TRMT)
0010 0000 0000 00209 BANKSEL _TXSTA_bits
0012 1C80 00210 BTFSS _TXSTA_bits,1
0013 2800 00211 GOTO _00339_DS_
00212 ; .line 909; "serial1.c" TXIE = 0;
0014 1200 00213 BCF _PIE1_bits,4
gpasm-0.13.4 beta serial1.asm 6-13-2008 14:34:00 PAGE 5
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
0015 2800 00214 GOTO _00339_DS_
0016 00215 _00336_DS_
00216 ; .line 911; "serial1.c" TXREG = transmitBuffer[transmitBufferHead];
0016 0000 0000 00217 BANKSEL _transmitBufferHead
0018 0800 00218 MOVF _transmitBufferHead,W
0019 3E00 00219 ADDLW (_transmitBuffer + 0)
001A 0000 0000 00220 BANKSEL r0x1012
001C 0080 00221 MOVWF r0x1012
001D 3000 00222 MOVLW high (_transmitBuffer + 0)
001E 1803 00223 BTFSC STATUS,0
001F 3E01 00224 ADDLW 0x01
0020 0080 00225 MOVWF r0x1013
0021 0800 00226 MOVF r0x1012,W
0022 0084 00227 MOVWF FSR
0023 1383 00228 BCF STATUS,7
0024 1800 00229 BTFSC r0x1013,0
0025 1783 00230 BSF STATUS,7
0026 0800 00231 MOVF INDF,W
0027 0000 0000 00232 BANKSEL _TXREG
0029 0080 00233 MOVWF _TXREG
00234 ; .line 912; "serial1.c" transmitBufferHead++;
002A 0000 0000 00235 BANKSEL _transmitBufferHead
002C 0A80 00236 INCF _transmitBufferHead,F
00237 ;unsigned compare: left < lit(0x10=16), size=1
00238 ; .line 913; "serial1.c" if (transmitBufferHead >= MAX_TRANSMIT_BUFFER)
002D 3010 00239 MOVLW 0x10
00240 ; .line 914; "serial1.c" transmitBufferHead = 0;
002E 0200 00241 SUBWF _transmitBufferHead,W
00242 ; .line 928; "serial1.c" if (RCIF) {
002F 1803 00243 BTFSC STATUS,0
0030 0180 00244 CLRF _transmitBufferHead
0031 00245 _00339_DS_
0031 0000 0000 00246 BANKSEL _PIR1_bits
0033 1E80 00247 BTFSS _PIR1_bits,5
0034 2800 00248 GOTO _00342_DS_
00249 ; .line 929; "serial1.c" uartNotifyReceive();
0035 2000 00250 CALL _uartNotifyReceive
0036 00251 _00342_DS_
0036 0000 0000 00252 BANKSEL _uartState;
0038 0008 00253 RETURN
00254 ; exit point of _serialInterruptHandler
00255
00256 ;***
00257 ; pBlock Stats: dbName = C
00258 ;***
00259 ;entry: _endMessage ;Function start
00260 ; 2 exit points
00261 ;has an exit
00262 ;functions called:
00263 ; _delay_10us
00264 ; _delay_10us
00265 ; _delay_10us
00266 ; _delay_10us
00267 ; _delay_10us
gpasm-0.13.4 beta serial1.asm 6-13-2008 14:34:00 PAGE 6
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
00268 ; _endMessageIntern
00269 ; _delay_10us
00270 ; _delay_10us
00271 ; _delay_10us
00272 ; _delay_10us
00273 ; _delay_10us
00274 ; _endMessageIntern
00275 ;; Starting pCode block
0039 00276 _endMessage ;Function start
00277 ; 2 exit points
00278 ; .line 881; "serial1.c" GIE=0;
0039 0000 0000 00279 BANKSEL _INTCON_bits
003B 1380 00280 BCF _INTCON_bits,7
003C 00281 _00324_DS_
00282 ; .line 883; "serial1.c" while (serialStatus & inTransmitMsgBit) {
003C 0000 0000 00283 BANKSEL _serialStatus
003E 1C80 00284 BTFSS _serialStatus,1
003F 2800 00285 GOTO _00326_DS_
00286 ; .line 884; "serial1.c" GIE=1;
0040 0000 0000 00287 BANKSEL _INTCON_bits
0042 1780 00288 BSF _INTCON_bits,7
00289 ; .line 885; "serial1.c" delay_10us();
0043 0000 00290 PAGESEL _delay_10us
0044 2000 00291 CALL _delay_10us
0045 0000 00292 PAGESEL $
00293 ; .line 886; "serial1.c" delay_10us();
0046 0000 00294 PAGESEL _delay_10us
0047 2000 00295 CALL _delay_10us
0048 0000 00296 PAGESEL $
00297 ; .line 887; "serial1.c" delay_10us();
0049 0000 00298 PAGESEL _delay_10us
004A 2000 00299 CALL _delay_10us
004B 0000 00300 PAGESEL $
00301 ; .line 888; "serial1.c" delay_10us();
004C 0000 00302 PAGESEL _delay_10us
004D 2000 00303 CALL _delay_10us
004E 0000 00304 PAGESEL $
00305 ; .line 889; "serial1.c" delay_10us();
004F 0000 00306 PAGESEL _delay_10us
0050 2000 00307 CALL _delay_10us
0051 0000 00308 PAGESEL $
00309 ; .line 890; "serial1.c" GIE=0;
0052 0000 0000 00310 BANKSEL _INTCON_bits
0054 1380 00311 BCF _INTCON_bits,7
0055 2800 00312 GOTO _00324_DS_
0056 00313 _00326_DS_
00314 ; .line 892; "serial1.c" endMessageIntern();
0056 2000 00315 CALL _endMessageIntern
00316 ; .line 893; "serial1.c" GIE=1;
0057 0000 0000 00317 BANKSEL _INTCON_bits
0059 1780 00318 BSF _INTCON_bits,7
005A 0008 00319 RETURN
00320 ; exit point of _endMessage
00321
gpasm-0.13.4 beta serial1.asm 6-13-2008 14:34:00 PAGE 7
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
00322 ;***
00323 ; pBlock Stats: dbName = C
00324 ;***
00325 ;entry: _endMessageISR ;Function start
00326 ; 2 exit points
00327 ;has an exit
00328 ;functions called:
00329 ; _endMessageIntern
00330 ; _endMessageIntern
00331 ;; Starting pCode block
005B 00332 _endMessageISR ;Function start
00333 ; 2 exit points
00334 ; .line 867; "serial1.c" endMessageIntern();
005B 2000 00335 CALL _endMessageIntern
005C 0008 00336 RETURN
00337 ; exit point of _endMessageISR
00338
00339 ;***
00340 ; pBlock Stats: dbName = C
00341 ;***
00342 ;entry: _endMessageIntern ;Function start
00343 ; 2 exit points
00344 ;has an exit
00345 ;functions called:
00346 ; _uartTransmit
00347 ; _computeCRC
00348 ; _uartTransmit
00349 ; _computeCRC
00350 ; _uartTransmit
00351 ; _computeCRC
00352 ; _uartTransmit
00353 ; _computeCRC
00354 ; _uartTransmit
00355 ; _computeCRC
00356 ; _uartTransmit
00357 ; _uartTransmit
00358 ; _uartTransmit
00359 ; _computeCRC
00360 ; _uartTransmit
00361 ; _computeCRC
00362 ; _uartTransmit
00363 ; _computeCRC
00364 ; _uartTransmit
00365 ; _computeCRC
00366 ; _uartTransmit
00367 ; _computeCRC
00368 ; _uartTransmit
00369 ; _uartTransmit
00370 ;4 compiler assigned registers:
00371 ; r0x101C
00372 ; r0x101D
00373 ; r0x101E
00374 ; r0x101F
00375 ;; Starting pCode block
gpasm-0.13.4 beta serial1.asm 6-13-2008 14:34:00 PAGE 8
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
005D 00376 _endMessageIntern ;Function start
00377 ; 2 exit points
00378 ; .line 840; "serial1.c" if (serialStatus & inSendQueueMsgBit) {
005D 0000 0000 00379 BANKSEL _serialStatus
005F 1D00 00380 BTFSS _serialStatus,2
0060 2800 00381 GOTO _00315_DS_
00382 ; .line 844; "serial1.c" uartTransmit(SNAP_SYNC);
0061 3054 00383 MOVLW 0x54
0062 2000 00384 CALL _uartTransmit
00385 ; .line 845; "serial1.c" crc = 0;
0063 0000 0000 00386 BANKSEL _crc
0065 0180 00387 CLRF _crc
00388 ; .line 846; "serial1.c" uartTransmit(computeCRC(BIN(01010001))); // Request ACK
0066 3051 00389 MOVLW 0x51
0067 2000 00390 CALL _computeCRC
0068 0000 0000 00391 BANKSEL r0x101C
006A 0080 00392 MOVWF r0x101C
006B 2000 00393 CALL _uartTransmit
00394 ; .line 847; "serial1.c" uartTransmit(computeCRC(BIN(00110000) | sendPacketLength));
006C 3030 00395 MOVLW 0x30
006D 0000 0000 00396 BANKSEL _sendPacketLength
006F 0400 00397 IORWF _sendPacketLength,W
0070 0000 0000 00398 BANKSEL r0x101C
0072 0080 00399 MOVWF r0x101C
0073 2000 00400 CALL _computeCRC
0074 0000 0000 00401 BANKSEL r0x101C
0076 0080 00402 MOVWF r0x101C
0077 2000 00403 CALL _uartTransmit
00404 ; .line 848; "serial1.c" uartTransmit(computeCRC(sendPacketDestination));
0078 0000 0000 00405 BANKSEL _sendPacketDestination
007A 0800 00406 MOVF _sendPacketDestination,W
007B 2000 00407 CALL _computeCRC
007C 0000 0000 00408 BANKSEL r0x101C
007E 0080 00409 MOVWF r0x101C
007F 2000 00410 CALL _uartTransmit
00411 ; .line 849; "serial1.c" uartTransmit(computeCRC(deviceAddress));
0080 0000 0000 00412 BANKSEL _deviceAddress
0082 0800 00413 MOVF _deviceAddress,W
0083 2000 00414 CALL _computeCRC
0084 0000 0000 00415 BANKSEL r0x101C
0086 0080 00416 MOVWF r0x101C
0087 2000 00417 CALL _uartTransmit
00418 ; .line 850; "serial1.c" for(i = 0; i < sendPacketLength; i++)
0088 0000 0000 00419 BANKSEL r0x101C
008A 0180 00420 CLRF r0x101C
008B 00421 _00311_DS_
008B 0000 0000 00422 BANKSEL _sendPacketLength
008D 0800 00423 MOVF _sendPacketLength,W
008E 0000 0000 00424 BANKSEL r0x101C
0090 0200 00425 SUBWF r0x101C,W
0091 1803 00426 BTFSC STATUS,0
0092 2800 00427 GOTO _00314_DS_
00428 ;genSkipc:3694: created from rifx:0xbffdc340
00429 ; .line 851; "serial1.c" uartTransmit(computeCRC(sendPacket[i]));
gpasm-0.13.4 beta serial1.asm 6-13-2008 14:34:00 PAGE 9
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
0093 0800 00430 MOVF r0x101C,W
0094 3E00 00431 ADDLW (_sendPacket + 0)
0095 0080 00432 MOVWF r0x101D
0096 3000 00433 MOVLW high (_sendPacket + 0)
0097 1803 00434 BTFSC STATUS,0
0098 3E01 00435 ADDLW 0x01
0099 0080 00436 MOVWF r0x101E
009A 0800 00437 MOVF r0x101D,W
009B 0084 00438 MOVWF FSR
009C 1383 00439 BCF STATUS,7
009D 1800 00440 BTFSC r0x101E,0
009E 1783 00441 BSF STATUS,7
009F 0800 00442 MOVF INDF,W
00443 ;;1 MOVWF r0x101F
00A0 2000 00444 CALL _computeCRC
00A1 0000 0000 00445 BANKSEL r0x101D
00A3 0080 00446 MOVWF r0x101D
00A4 2000 00447 CALL _uartTransmit
00448 ; .line 850; "serial1.c" for(i = 0; i < sendPacketLength; i++)
00A5 0000 0000 00449 BANKSEL r0x101C
00A7 0A80 00450 INCF r0x101C,F
00A8 2800 00451 GOTO _00311_DS_
00A9 00452 _00314_DS_
00453 ; .line 852; "serial1.c" uartTransmit(crc); /// @todo crc here
00A9 0000 0000 00454 BANKSEL _crc
00AB 0800 00455 MOVF _crc,W
00AC 2000 00456 CALL _uartTransmit
00457 ; .line 854; "serial1.c" serialStatus &= ~inSendQueueMsgBit; //clear
00AD 0000 0000 00458 BANKSEL _serialStatus
00AF 1100 00459 BCF _serialStatus,2
00B0 00460 _00315_DS_
00B0 0008 00461 RETURN
00462 ; exit point of _endMessageIntern
00463
00464 ;***
00465 ; pBlock Stats: dbName = C
00466 ;***
00467 ;entry: _packetReady ;Function start
00468 ; 2 exit points
00469 ;has an exit
00470 ;1 compiler assigned register :
00471 ; r0x1020
00472 ;; Starting pCode block
00B1 00473 _packetReady ;Function start
00474 ; 2 exit points
00475 ; .line 821; "serial1.c" GIE=0;
00B1 0000 0000 00476 BANKSEL _INTCON_bits
00B3 1380 00477 BCF _INTCON_bits,7
00478 ; .line 822; "serial1.c" ready = (serialStatus & processingLockBit);
00B4 3080 00479 MOVLW 0x80
00B5 0000 0000 00480 BANKSEL _serialStatus
00B7 0500 00481 ANDWF _serialStatus,W
00B8 0000 0000 00482 BANKSEL r0x1020
00BA 0080 00483 MOVWF r0x1020
gpasm-0.13.4 beta serial1.asm 6-13-2008 14:34:00 PAGE 10
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
00484 ; .line 823; "serial1.c" if (transmitBufferHead != transmitBufferTail)
00BB 0000 0000 00485 BANKSEL _transmitBufferTail
00BD 0800 00486 MOVF _transmitBufferTail,W
00487 ; .line 824; "serial1.c" ready = 0;
00BE 0000 0000 00488 BANKSEL _transmitBufferHead
00C0 0600 00489 XORWF _transmitBufferHead,W
00490 ; .line 825; "serial1.c" GIE=1;
00C1 1903 00491 BTFSC STATUS,2
00C2 2800 00492 GOTO _00001_DS_
00C3 0000 0000 00493 BANKSEL r0x1020
00C5 0180 00494 CLRF r0x1020
00C6 00495 _00001_DS_
00C6 0000 0000 00496 BANKSEL _INTCON_bits
00C8 1780 00497 BSF _INTCON_bits,7
00498 ; .line 826; "serial1.c" return ready;
00C9 0000 0000 00499 BANKSEL r0x1020
00CB 0800 00500 MOVF r0x1020,W
00CC 0008 00501 RETURN
00502 ; exit point of _packetReady
00503
00504 ;***
00505 ; pBlock Stats: dbName = C
00506 ;***
00507 ;entry: _sendReply ;Function start
00508 ; 2 exit points
00509 ;has an exit
00510 ;functions called:
00511 ; _sendMessage
00512 ; _sendMessage
00513 ;; Starting pCode block
00CD 00514 _sendReply ;Function start
00515 ; 2 exit points
00516 ; .line 809; "serial1.c" sendMessage(receivedSourceAddress);
00CD 0000 0000 00517 BANKSEL _receivedSourceAddress
00CF 0800 00518 MOVF _receivedSourceAddress,W
00D0 2000 00519 CALL _sendMessage
00D1 0008 00520 RETURN
00521 ; exit point of _sendReply
00522
00523 ;***
00524 ; pBlock Stats: dbName = C
00525 ;***
00526 ;entry: _sendMessage ;Function start
00527 ; 2 exit points
00528 ;has an exit
00529 ;functions called:
00530 ; _delay_10us
00531 ; _delay_10us
00532 ; _delay_10us
00533 ; _delay_10us
00534 ; _delay_10us
00535 ; _sendMessageIntern
00536 ; _delay_10us
00537 ; _delay_10us
gpasm-0.13.4 beta serial1.asm 6-13-2008 14:34:00 PAGE 11
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
00538 ; _delay_10us
00539 ; _delay_10us
00540 ; _delay_10us
00541 ; _sendMessageIntern
00542 ;1 compiler assigned register :
00543 ; r0x1021
00544 ;; Starting pCode block
00D2 00545 _sendMessage ;Function start
00546 ; 2 exit points
00547 ; .line 786; "serial1.c" void sendMessage(byte dest)
00D2 0000 0000 00548 BANKSEL r0x1021
00D4 0080 00549 MOVWF r0x1021
00550 ; .line 788; "serial1.c" GIE=0;
00D5 0000 0000 00551 BANKSEL _INTCON_bits
00D7 1380 00552 BCF _INTCON_bits,7
00D8 00553 _00288_DS_
00554 ; .line 789; "serial1.c" while (serialStatus & inSendQueueMsgBit) {
00D8 0000 0000 00555 BANKSEL _serialStatus
00DA 1D00 00556 BTFSS _serialStatus,2
00DB 2800 00557 GOTO _00290_DS_
00558 ; .line 791; "serial1.c" GIE=1;
00DC 0000 0000 00559 BANKSEL _INTCON_bits
00DE 1780 00560 BSF _INTCON_bits,7
00561 ; .line 792; "serial1.c" delay_10us();
00DF 0000 00562 PAGESEL _delay_10us
00E0 2000 00563 CALL _delay_10us
00E1 0000 00564 PAGESEL $
00565 ; .line 793; "serial1.c" delay_10us();
00E2 0000 00566 PAGESEL _delay_10us
00E3 2000 00567 CALL _delay_10us
00E4 0000 00568 PAGESEL $
00569 ; .line 794; "serial1.c" delay_10us();
00E5 0000 00570 PAGESEL _delay_10us
00E6 2000 00571 CALL _delay_10us
00E7 0000 00572 PAGESEL $
00573 ; .line 795; "serial1.c" delay_10us();
00E8 0000 00574 PAGESEL _delay_10us
00E9 2000 00575 CALL _delay_10us
00EA 0000 00576 PAGESEL $
00577 ; .line 796; "serial1.c" delay_10us();
00EB 0000 00578 PAGESEL _delay_10us
00EC 2000 00579 CALL _delay_10us
00ED 0000 00580 PAGESEL $
00581 ; .line 797; "serial1.c" GIE=0;
00EE 0000 0000 00582 BANKSEL _INTCON_bits
00F0 1380 00583 BCF _INTCON_bits,7
00F1 2800 00584 GOTO _00288_DS_
00F2 00585 _00290_DS_
00586 ; .line 800; "serial1.c" sendMessageIntern(dest);
00F2 0000 0000 00587 BANKSEL r0x1021
00F4 0800 00588 MOVF r0x1021,W
00F5 2000 00589 CALL _sendMessageIntern
00590 ; .line 801; "serial1.c" GIE=1;
00F6 0000 0000 00591 BANKSEL _INTCON_bits
gpasm-0.13.4 beta serial1.asm 6-13-2008 14:34:00 PAGE 12
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
00F8 1780 00592 BSF _INTCON_bits,7
00F9 0008 00593 RETURN
00594 ; exit point of _sendMessage
00595
00596 ;***
00597 ; pBlock Stats: dbName = C
00598 ;***
00599 ;entry: _sendMessageISR ;Function start
00600 ; 2 exit points
00601 ;has an exit
00602 ;functions called:
00603 ; _sendMessageIntern
00604 ; _sendMessageIntern
00605 ;1 compiler assigned register :
00606 ; r0x1023
00607 ;; Starting pCode block
00FA 00608 _sendMessageISR ;Function start
00609 ; 2 exit points
00610 ; .line 759; "serial1.c" byte sendMessageISR(byte dest)
00FA 0000 0000 00611 BANKSEL r0x1023
00FC 0080 00612 MOVWF r0x1023
00613 ; .line 766; "serial1.c" if ((serialStatus & inSendQueueMsgBit) || (serialStatus & inTransmitMsgBit) ||
00FD 0000 0000 00614 BANKSEL _serialStatus
00FF 1900 00615 BTFSC _serialStatus,2
0100 2800 00616 GOTO _00274_DS_
0101 1880 00617 BTFSC _serialStatus,1
0102 2800 00618 GOTO _00274_DS_
00619 ; .line 767; "serial1.c" (transmitBufferHead != transmitBufferTail)) {
0103 0000 0000 00620 BANKSEL _transmitBufferTail
0105 0800 00621 MOVF _transmitBufferTail,W
00622 ; .line 768; "serial1.c" return 0;
0106 0000 0000 00623 BANKSEL _transmitBufferHead
0108 0600 00624 XORWF _transmitBufferHead,W
0109 1903 00625 BTFSC STATUS,2
010A 2800 00626 GOTO _00275_DS_
010B 00627 _00274_DS_
010B 3000 00628 MOVLW 0x00
010C 2800 00629 GOTO _00279_DS_
010D 00630 _00275_DS_
00631 ; .line 770; "serial1.c" sendMessageIntern(dest);
010D 0000 0000 00632 BANKSEL r0x1023
010F 0800 00633 MOVF r0x1023,W
0110 2000 00634 CALL _sendMessageIntern
00635 ; .line 772; "serial1.c" return 1;
0111 3001 00636 MOVLW 0x01
0112 00637 _00279_DS_
0112 0008 00638 RETURN
00639 ; exit point of _sendMessageISR
00640
00641 ;***
00642 ; pBlock Stats: dbName = C
00643 ;***
00644 ;entry: _sendMessageIntern ;Function start
00645 ; 2 exit points
gpasm-0.13.4 beta serial1.asm 6-13-2008 14:34:00 PAGE 13
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
00646 ;has an exit
00647 ;1 compiler assigned register :
00648 ; r0x1022
00649 ;; Starting pCode block
0113 00650 _sendMessageIntern ;Function start
00651 ; 2 exit points
00652 ; .line 745; "serial1.c" static void sendMessageIntern(byte dest)
0113 0000 0000 00653 BANKSEL r0x1022
0115 0080 00654 MOVWF r0x1022
00655 ; .line 747; "serial1.c" serialStatus |= inSendQueueMsgBit; //set bit
0116 0000 0000 00656 BANKSEL _serialStatus
0118 1500 00657 BSF _serialStatus,2
00658 ; .line 748; "serial1.c" sendPacketDestination = dest;
0119 0000 0000 00659 BANKSEL r0x1022
011B 0800 00660 MOVF r0x1022,W
011C 0000 0000 00661 BANKSEL _sendPacketDestination
011E 0080 00662 MOVWF _sendPacketDestination
00663 ; .line 749; "serial1.c" sendPacketLength = 0;
011F 0000 0000 00664 BANKSEL _sendPacketLength
0121 0180 00665 CLRF _sendPacketLength
0122 0008 00666 RETURN
00667 ; exit point of _sendMessageIntern
00668
00669 ;***
00670 ; pBlock Stats: dbName = C
00671 ;***
00672 ;entry: _releaseLock ;Function start
00673 ; 2 exit points
00674 ;has an exit
00675 ;; Starting pCode block
0123 00676 _releaseLock ;Function start
00677 ; 2 exit points
00678 ; .line 735; "serial1.c" GIE=0;
0123 0000 0000 00679 BANKSEL _INTCON_bits
0125 1380 00680 BCF _INTCON_bits,7
00681 ; .line 736; "serial1.c" serialStatus &= ~processingLockBit; //clear
0126 0000 0000 00682 BANKSEL _serialStatus
0128 1380 00683 BCF _serialStatus,7
00684 ; .line 737; "serial1.c" GIE=1;
0129 0000 0000 00685 BANKSEL _INTCON_bits
012B 1780 00686 BSF _INTCON_bits,7
012C 0008 00687 RETURN
00688 ; exit point of _releaseLock
00689
00690 ;***
00691 ; pBlock Stats: dbName = C
00692 ;***
00693 ;entry: _sendDataByteISR ;Function start
00694 ; 2 exit points
00695 ;has an exit
00696 ;functions called:
00697 ; _sendDataByteIntern
00698 ; _sendDataByteIntern
00699 ;1 compiler assigned register :
gpasm-0.13.4 beta serial1.asm 6-13-2008 14:34:00 PAGE 14
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
00700 ; r0x1024
00701 ;; Starting pCode block
012D 00702 _sendDataByteISR ;Function start
00703 ; 2 exit points
00704 ;;1 MOVWF r0x1024
00705 ; .line 726; "serial1.c" sendDataByteIntern(c);
012D 2000 00706 CALL _sendDataByteIntern
012E 0008 00707 RETURN
00708 ; exit point of _sendDataByteISR
00709
00710 ;***
00711 ; pBlock Stats: dbName = C
00712 ;***
00713 ;entry: _sendDataByte ;Function start
00714 ; 2 exit points
00715 ;has an exit
00716 ;functions called:
00717 ; _sendDataByteIntern
00718 ; _sendDataByteIntern
00719 ;1 compiler assigned register :
00720 ; r0x1028
00721 ;; Starting pCode block
012F 00722 _sendDataByte ;Function start
00723 ; 2 exit points
00724 ; .line 713; "serial1.c" void sendDataByte(byte c)
012F 0000 0000 00725 BANKSEL r0x1028
0131 0080 00726 MOVWF r0x1028
00727 ; .line 715; "serial1.c" GIE=0;
0132 0000 0000 00728 BANKSEL _INTCON_bits
0134 1380 00729 BCF _INTCON_bits,7
00730 ; .line 716; "serial1.c" sendDataByteIntern(c);
0135 0000 0000 00731 BANKSEL r0x1028
0137 0800 00732 MOVF r0x1028,W
0138 2000 00733 CALL _sendDataByteIntern
00734 ; .line 717; "serial1.c" GIE=1;
0139 0000 0000 00735 BANKSEL _INTCON_bits
013B 1780 00736 BSF _INTCON_bits,7
013C 0008 00737 RETURN
00738 ; exit point of _sendDataByte
00739
00740 ;***
00741 ; pBlock Stats: dbName = C
00742 ;***
00743 ;entry: _sendDataByteIntern ;Function start
00744 ; 2 exit points
00745 ;has an exit
00746 ;3 compiler assigned registers:
00747 ; r0x1025
00748 ; r0x1026
00749 ; r0x1027
00750 ;; Starting pCode block
013D 00751 _sendDataByteIntern ;Function start
00752 ; 2 exit points
00753 ; .line 694; "serial1.c" static void sendDataByteIntern(byte c)
gpasm-0.13.4 beta serial1.asm 6-13-2008 14:34:00 PAGE 15
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
013D 0000 0000 00754 BANKSEL r0x1025
013F 0080 00755 MOVWF r0x1025
00756 ; .line 696; "serial1.c" if (serialStatus & inSendQueueMsgBit) {
0140 0000 0000 00757 BANKSEL _serialStatus
0142 1D00 00758 BTFSS _serialStatus,2
0143 2800 00759 GOTO _00253_DS_
00760 ;unsigned compare: left < lit(0x10=16), size=1
00761 ; .line 700; "serial1.c" if (sendPacketLength < MAX_PAYLOAD)
0144 3010 00762 MOVLW 0x10
0145 0000 0000 00763 BANKSEL _sendPacketLength
0147 0200 00764 SUBWF _sendPacketLength,W
0148 1803 00765 BTFSC STATUS,0
0149 2800 00766 GOTO _00253_DS_
00767 ;genSkipc:3694: created from rifx:0xbffdc340
00768 ; .line 701; "serial1.c" sendPacket[sendPacketLength++] = c;
014A 0800 00769 MOVF _sendPacketLength,W
014B 0000 0000 00770 BANKSEL r0x1026
014D 0080 00771 MOVWF r0x1026
014E 0000 0000 00772 BANKSEL _sendPacketLength
0150 0A80 00773 INCF _sendPacketLength,F
0151 0000 0000 00774 BANKSEL r0x1026
0153 0800 00775 MOVF r0x1026,W
0154 3E00 00776 ADDLW (_sendPacket + 0)
0155 0080 00777 MOVWF r0x1026
0156 3000 00778 MOVLW high (_sendPacket + 0)
0157 1803 00779 BTFSC STATUS,0
0158 3E01 00780 ADDLW 0x01
0159 0080 00781 MOVWF r0x1027
015A 0800 00782 MOVF r0x1026,W
015B 0084 00783 MOVWF FSR
015C 1383 00784 BCF STATUS,7
015D 1800 00785 BTFSC r0x1027,0
015E 1783 00786 BSF STATUS,7
015F 0800 00787 MOVF r0x1025,W
0160 0080 00788 MOVWF INDF
0161 00789 _00253_DS_
0161 0000 0000 00790 BANKSEL _uartState;
0163 0008 00791 RETURN
00792 ; exit point of _sendDataByteIntern
00793
00794 ;***
00795 ; pBlock Stats: dbName = C
00796 ;***
00797 ;entry: _uartTransmit ;Function start
00798 ; 2 exit points
00799 ;has an exit
00800 ;4 compiler assigned registers:
00801 ; r0x1018
00802 ; r0x1019
00803 ; r0x101A
00804 ; r0x101B
00805 ;; Starting pCode block
0164 00806 _uartTransmit ;Function start
00807 ; 2 exit points
gpasm-0.13.4 beta serial1.asm 6-13-2008 14:34:00 PAGE 16
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
00808 ; .line 663; "serial1.c" void uartTransmit(byte c)
0164 0000 0000 00809 BANKSEL r0x1018
0166 0080 00810 MOVWF r0x1018
00811 ; .line 668; "serial1.c" newTail = transmitBufferTail + 1;
0167 0000 0000 00812 BANKSEL _transmitBufferTail
0169 0A00 00813 INCF _transmitBufferTail,W
016A 0000 0000 00814 BANKSEL r0x1019
016C 0080 00815 MOVWF r0x1019
00816 ;unsigned compare: left < lit(0x10=16), size=1
00817 ; .line 669; "serial1.c" if (newTail >= MAX_TRANSMIT_BUFFER)
016D 3010 00818 MOVLW 0x10
00819 ; .line 670; "serial1.c" newTail = 0;
016E 0200 00820 SUBWF r0x1019,W
00821 ; .line 674; "serial1.c" if (newTail != transmitBufferHead) {
016F 1803 00822 BTFSC STATUS,0
0170 0180 00823 CLRF r0x1019
0171 0000 0000 00824 BANKSEL _transmitBufferHead
0173 0800 00825 MOVF _transmitBufferHead,W
00826 ; .line 675; "serial1.c" transmitBuffer[transmitBufferTail] = c;
0174 0000 0000 00827 BANKSEL r0x1019
0176 0600 00828 XORWF r0x1019,W
0177 1903 00829 BTFSC STATUS,2
0178 2800 00830 GOTO _00238_DS_
0179 0000 0000 00831 BANKSEL _transmitBufferTail
017B 0800 00832 MOVF _transmitBufferTail,W
017C 3E00 00833 ADDLW (_transmitBuffer + 0)
017D 0000 0000 00834 BANKSEL r0x101A
017F 0080 00835 MOVWF r0x101A
0180 3000 00836 MOVLW high (_transmitBuffer + 0)
0181 1803 00837 BTFSC STATUS,0
0182 3E01 00838 ADDLW 0x01
0183 0080 00839 MOVWF r0x101B
0184 0800 00840 MOVF r0x101A,W
0185 0084 00841 MOVWF FSR
0186 1383 00842 BCF STATUS,7
0187 1800 00843 BTFSC r0x101B,0
0188 1783 00844 BSF STATUS,7
0189 0800 00845 MOVF r0x1018,W
018A 0080 00846 MOVWF INDF
00847 ; .line 676; "serial1.c" transmitBufferTail = newTail;
018B 0800 00848 MOVF r0x1019,W
018C 0000 0000 00849 BANKSEL _transmitBufferTail
018E 0080 00850 MOVWF _transmitBufferTail
00851 ; .line 678; "serial1.c" if (TXIE == 0) {
018F 0000 0000 00852 BANKSEL _PIE1_bits
0191 1A00 00853 BTFSC _PIE1_bits,4
0192 2800 00854 GOTO _00238_DS_
00855 ; .line 679; "serial1.c" TXIE=1; //enabling TXIE sets also TXIF
0193 1600 00856 BSF _PIE1_bits,4
0194 00857 _00238_DS_
0194 0000 0000 00858 BANKSEL _uartState;
0196 0008 00859 RETURN
00860 ; exit point of _uartTransmit
00861
gpasm-0.13.4 beta serial1.asm 6-13-2008 14:34:00 PAGE 17
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
00862 ;***
00863 ; pBlock Stats: dbName = C
00864 ;***
00865 ;entry: _uartNotifyReceive ;Function start
00866 ; 2 exit points
00867 ;has an exit
00868 ;functions called:
00869 ; _uartReceiveError
00870 ; _uartReceiveError
00871 ; _computeCRC
00872 ; _uartReceiveError
00873 ; _computeCRC
00874 ; _uartTransmit
00875 ; _uartTransmit
00876 ; _uartTransmit
00877 ; _uartTransmit
00878 ; _computeCRC
00879 ; _uartTransmit
00880 ; _computeCRC
00881 ; _uartTransmit
00882 ; _computeCRC
00883 ; _uartTransmit
00884 ; _computeCRC
00885 ; _uartTransmit
00886 ; _computeCRC
00887 ; _uartTransmit
00888 ; _uartTransmit
00889 ; _computeCRC
00890 ; _computeCRC
00891 ; _uartTransmit
00892 ; _computeCRC
00893 ; _uartTransmit
00894 ; _computeCRC
00895 ; _uartTransmit
00896 ; _computeCRC
00897 ; _uartTransmit
00898 ; _computeCRC
00899 ; _uartTransmit
00900 ; _uartTransmit
00901 ; _uartTransmit
00902 ; _uartTransmit
00903 ; _uartTransmit
00904 ; _uartTransmit
00905 ; _uartReceiveError
00906 ; _uartReceiveError
00907 ; _uartReceiveError
00908 ; _computeCRC
00909 ; _uartReceiveError
00910 ; _computeCRC
00911 ; _uartTransmit
00912 ; _uartTransmit
00913 ; _uartTransmit
00914 ; _uartTransmit
00915 ; _computeCRC
gpasm-0.13.4 beta serial1.asm 6-13-2008 14:34:00 PAGE 18
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
00916 ; _uartTransmit
00917 ; _computeCRC
00918 ; _uartTransmit
00919 ; _computeCRC
00920 ; _uartTransmit
00921 ; _computeCRC
00922 ; _uartTransmit
00923 ; _computeCRC
00924 ; _uartTransmit
00925 ; _uartTransmit
00926 ; _computeCRC
00927 ; _computeCRC
00928 ; _uartTransmit
00929 ; _computeCRC
00930 ; _uartTransmit
00931 ; _computeCRC
00932 ; _uartTransmit
00933 ; _computeCRC
00934 ; _uartTransmit
00935 ; _computeCRC
00936 ; _uartTransmit
00937 ; _uartTransmit
00938 ; _uartTransmit
00939 ; _uartTransmit
00940 ; _uartTransmit
00941 ; _uartTransmit
00942 ; _uartReceiveError
00943 ;3 compiler assigned registers:
00944 ; r0x1014
00945 ; r0x1015
00946 ; r0x1016
00947 ;; Starting pCode block
0197 00948 _uartNotifyReceive ;Function start
00949 ; 2 exit points
00950 ; .line 434; "serial1.c" c = RCREG;
0197 0000 0000 00951 BANKSEL _RCREG
0199 0800 00952 MOVF _RCREG,W
00953 ; .line 439; "serial1.c" if (OERR) {
019A 0000 0000 00954 BANKSEL r0x1014
019C 0080 00955 MOVWF r0x1014
00956 ; .line 440; "serial1.c" CREN = 0;
019D 0000 0000 00957 BANKSEL _RCSTA_bits
019F 1880 00958 BTFSC _RCSTA_bits,1
00959 ; .line 445; "serial1.c" CREN = 1;
01A0 1200 00960 BCF _RCSTA_bits,4
01A1 1600 00961 BSF _RCSTA_bits,4
00962 ; .line 447; "serial1.c" if (serialStatus & serialErrorBit) {
01A2 0000 0000 00963 BANKSEL _serialStatus
01A4 1C00 00964 BTFSS _serialStatus,0
01A5 2800 00965 GOTO _00159_DS_
00966 ; .line 448; "serial1.c" uartReceiveError();
01A6 2000 00967 CALL _uartReceiveError
00968 ; .line 449; "serial1.c" return;
01A7 2800 00969 GOTO _00204_DS_
gpasm-0.13.4 beta serial1.asm 6-13-2008 14:34:00 PAGE 19
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
01A8 00970 _00159_DS_
00971 ; .line 453; "serial1.c" switch(uartState) {
01A8 0000 0000 00972 BANKSEL _uartState
01AA 0800 00973 MOVF _uartState,W
01AB 0000 0000 00974 BANKSEL r0x1015
01AD 0080 00975 MOVWF r0x1015
00976 ;unsigned compare: left < lit(0x30=48), size=1
01AE 3030 00977 MOVLW 0x30
01AF 0200 00978 SUBWF r0x1015,W
01B0 1C03 00979 BTFSS STATUS,0
01B1 2800 00980 GOTO _00202_DS_
00981 ;genSkipc:3694: created from rifx:0xbffdc340
00982 ;swapping arguments (AOP_TYPEs 1/2)
00983 ;unsigned compare: left >= lit(0x3B=59), size=1
01B2 303B 00984 MOVLW 0x3b
01B3 0200 00985 SUBWF r0x1015,W
01B4 1803 00986 BTFSC STATUS,0
01B5 2800 00987 GOTO _00202_DS_
00988 ;genSkipc:3694: created from rifx:0xbffdc340
01B6 30D0 00989 MOVLW 0xd0
01B7 0780 00990 ADDWF r0x1015,F
01B8 3000 00991 MOVLW HIGH(_00224_DS_)
01B9 008A 00992 MOVWF PCLATH
01BA 3000 00993 MOVLW _00224_DS_
01BB 0700 00994 ADDWF r0x1015,W
01BC 1803 00995 BTFSC STATUS,0
01BD 0A8A 00996 INCF PCLATH,F
01BE 1283 1303 00997 BANKSEL PCL
01C0 0082 00998 MOVWF PCL
01C1 00999 _00224_DS_
01C1 2800 01000 GOTO _00160_DS_
01C2 2800 01001 GOTO _00163_DS_
01C3 2800 01002 GOTO _00170_DS_
01C4 2800 01003 GOTO _00176_DS_
01C5 2800 01004 GOTO _00180_DS_
01C6 2800 01005 GOTO _00184_DS_
01C7 2800 01006 GOTO _00187_DS_
01C8 2800 01007 GOTO _00193_DS_
01C9 2800 01008 GOTO _00196_DS_
01CA 2800 01009 GOTO _00197_DS_
01CB 2800 01010 GOTO _00198_DS_
01CC 01011 _00160_DS_
01012 ; .line 459; "serial1.c" if (c == SNAP_SYNC) {
01CC 0000 0000 01013 BANKSEL r0x1014
01CE 0800 01014 MOVF r0x1014,W
01CF 3A54 01015 XORLW 0x54
01D0 1D03 01016 BTFSS STATUS,2
01D1 2800 01017 GOTO _00204_DS_
01018 ; .line 460; "serial1.c" uartState = SNAP_haveSync;
01D2 3031 01019 MOVLW 0x31
01D3 0000 0000 01020 BANKSEL _uartState
01D5 0080 01021 MOVWF _uartState
01022 ; .line 461; "serial1.c" serialStatus &= ~msgAbortedBit; //clear
01D6 0000 0000 01023 BANKSEL _serialStatus
gpasm-0.13.4 beta serial1.asm 6-13-2008 14:34:00 PAGE 20
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
01D8 1180 01024 BCF _serialStatus,3
01025 ; .line 463; "serial1.c" break;
01D9 2800 01026 GOTO _00204_DS_
01DA 01027 _00163_DS_
01028 ; .line 472; "serial1.c" in_hdb2 = c;
01DA 0000 0000 01029 BANKSEL r0x1014
01DC 0800 01030 MOVF r0x1014,W
01DD 0000 0000 01031 BANKSEL _in_hdb2
01DF 0080 01032 MOVWF _in_hdb2
01033 ; .line 473; "serial1.c" if ((c & BIN(11111100)) != BIN(01010000)) {
01E0 30FC 01034 MOVLW 0xfc
01E1 0000 0000 01035 BANKSEL r0x1014
01E3 0500 01036 ANDWF r0x1014,W
01E4 0080 01037 MOVWF r0x1015
01038 ; .line 475; "serial1.c" serialStatus |= serialErrorBit; //set serialError
01E5 3A50 01039 XORLW 0x50
01E6 1903 01040 BTFSC STATUS,2
01E7 2800 01041 GOTO _00168_DS_
01E8 0000 0000 01042 BANKSEL _serialStatus
01EA 1400 01043 BSF _serialStatus,0
01044 ; .line 476; "serial1.c" serialStatus |= wrongByteErrorBit;
01EB 1680 01045 BSF _serialStatus,5
01046 ; .line 477; "serial1.c" uartReceiveError();
01EC 2000 01047 CALL _uartReceiveError
01ED 2800 01048 GOTO _00204_DS_
01EE 01049 _00168_DS_
01050 ; .line 480; "serial1.c" if ((c & BIN(00000011)) == BIN(00000001))
01EE 3003 01051 MOVLW 0x03
01EF 0000 0000 01052 BANKSEL r0x1014
01F1 0500 01053 ANDWF r0x1014,W
01F2 0080 01054 MOVWF r0x1015
01F3 3A01 01055 XORLW 0x01
01F4 1D03 01056 BTFSS STATUS,2
01F5 2800 01057 GOTO _00165_DS_
01058 ; .line 481; "serial1.c" serialStatus |= ackRequestedBit; //set ackRequested-Bit
01F6 0000 0000 01059 BANKSEL _serialStatus
01F8 1700 01060 BSF _serialStatus,6
01F9 2800 01061 GOTO _00166_DS_
01FA 01062 _00165_DS_
01063 ; .line 483; "serial1.c" serialStatus &= ~ackRequestedBit; //clear
01FA 0000 0000 01064 BANKSEL _serialStatus
01FC 1300 01065 BCF _serialStatus,6
01FD 01066 _00166_DS_
01067 ; .line 484; "serial1.c" crc = 0;
01FD 0000 0000 01068 BANKSEL _crc
01FF 0180 01069 CLRF _crc
01070 ; .line 485; "serial1.c" computeCRC(c);
0200 0000 0000 01071 BANKSEL r0x1014
0202 0800 01072 MOVF r0x1014,W
0203 2000 01073 CALL _computeCRC
01074 ; .line 486; "serial1.c" uartState = SNAP_haveHDB2;
0204 3032 01075 MOVLW 0x32
0205 0000 0000 01076 BANKSEL _uartState
0207 0080 01077 MOVWF _uartState
gpasm-0.13.4 beta serial1.asm 6-13-2008 14:34:00 PAGE 21
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
01078 ; .line 488; "serial1.c" break;
0208 2800 01079 GOTO _00204_DS_
0209 01080 _00170_DS_
01081 ; .line 494; "serial1.c" in_hdb1 = c;
0209 0000 0000 01082 BANKSEL r0x1014
020B 0800 01083 MOVF r0x1014,W
020C 0000 0000 01084 BANKSEL _in_hdb1
020E 0080 01085 MOVWF _in_hdb1
01086 ; .line 495; "serial1.c" if ((c & BIN(11110000)) != BIN(00110000)) {
020F 30F0 01087 MOVLW 0xf0
0210 0000 0000 01088 BANKSEL r0x1014
0212 0500 01089 ANDWF r0x1014,W
0213 0080 01090 MOVWF r0x1015
01091 ; .line 496; "serial1.c" serialStatus |= serialErrorBit; //set serialError
0214 3A30 01092 XORLW 0x30
0215 1903 01093 BTFSC STATUS,2
0216 2800 01094 GOTO _00174_DS_
0217 0000 0000 01095 BANKSEL _serialStatus
0219 1400 01096 BSF _serialStatus,0
01097 ; .line 497; "serial1.c" serialStatus |= wrongByteErrorBit;
021A 1680 01098 BSF _serialStatus,5
01099 ; .line 498; "serial1.c" uartReceiveError();
021B 2000 01100 CALL _uartReceiveError
021C 2800 01101 GOTO _00204_DS_
021D 01102 _00174_DS_
01103 ; .line 500; "serial1.c" packetLength = c & 0x0f;
021D 300F 01104 MOVLW 0x0f
021E 0000 0000 01105 BANKSEL r0x1014
0220 0500 01106 ANDWF r0x1014,W
0221 0000 0000 01107 BANKSEL _packetLength
0223 0080 01108 MOVWF _packetLength
01109 ;swapping arguments (AOP_TYPEs 1/3)
01110 ;unsigned compare: left >= lit(0x11=17), size=1
01111 ; .line 501; "serial1.c" if (packetLength > MAX_PAYLOAD)
0224 3011 01112 MOVLW 0x11
0225 0200 01113 SUBWF _packetLength,W
0226 1C03 01114 BTFSS STATUS,0
0227 2800 01115 GOTO _00172_DS_
01116 ;genSkipc:3694: created from rifx:0xbffdc340
01117 ; .line 502; "serial1.c" packetLength = MAX_PAYLOAD;
0228 3010 01118 MOVLW 0x10
0229 0080 01119 MOVWF _packetLength
022A 01120 _00172_DS_
01121 ; .line 503; "serial1.c" computeCRC(c);
022A 0000 0000 01122 BANKSEL r0x1014
022C 0800 01123 MOVF r0x1014,W
022D 2000 01124 CALL _computeCRC
01125 ; .line 504; "serial1.c" uartState = SNAP_haveHDB1;
022E 3033 01126 MOVLW 0x33
022F 0000 0000 01127 BANKSEL _uartState
0231 0080 01128 MOVWF _uartState
01129 ; .line 506; "serial1.c" break;
0232 2800 01130 GOTO _00204_DS_
0233 01131 _00176_DS_
gpasm-0.13.4 beta serial1.asm 6-13-2008 14:34:00 PAGE 22
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
01132 ; .line 511; "serial1.c" if (c != deviceAddress) {
0233 0000 0000 01133 BANKSEL _deviceAddress
0235 0800 01134 MOVF _deviceAddress,W
01135 ; .line 512; "serial1.c" uartTransmit(SNAP_SYNC);
0236 0000 0000 01136 BANKSEL r0x1014
0238 0600 01137 XORWF r0x1014,W
0239 1903 01138 BTFSC STATUS,2
023A 2800 01139 GOTO _00178_DS_
023B 3054 01140 MOVLW 0x54
023C 0000 01141 PAGESEL _uartTransmit
023D 2000 01142 CALL _uartTransmit
023E 0000 01143 PAGESEL $
01144 ; .line 513; "serial1.c" uartTransmit(in_hdb2);
023F 0000 0000 01145 BANKSEL _in_hdb2
0241 0800 01146 MOVF _in_hdb2,W
0242 0000 01147 PAGESEL _uartTransmit
0243 2000 01148 CALL _uartTransmit
0244 0000 01149 PAGESEL $
01150 ; .line 514; "serial1.c" uartTransmit(in_hdb1);
0245 0000 0000 01151 BANKSEL _in_hdb1
0247 0800 01152 MOVF _in_hdb1,W
0248 0000 01153 PAGESEL _uartTransmit
0249 2000 01154 CALL _uartTransmit
024A 0000 01155 PAGESEL $
01156 ; .line 515; "serial1.c" uartTransmit(c);
024B 0000 0000 01157 BANKSEL r0x1014
024D 0800 01158 MOVF r0x1014,W
024E 0000 01159 PAGESEL _uartTransmit
024F 2000 01160 CALL _uartTransmit
0250 0000 01161 PAGESEL $
01162 ; .line 516; "serial1.c" uartState = SNAP_haveDABPass;
0251 3039 01163 MOVLW 0x39
0252 0000 0000 01164 BANKSEL _uartState
0254 0080 01165 MOVWF _uartState
01166 ; .line 517; "serial1.c" serialStatus &= ~ackRequestedBit; //clear
0255 0000 0000 01167 BANKSEL _serialStatus
0257 1300 01168 BCF _serialStatus,6
01169 ; .line 518; "serial1.c" serialStatus |= inTransmitMsgBit;
0258 1480 01170 BSF _serialStatus,1
0259 2800 01171 GOTO _00204_DS_
025A 01172 _00178_DS_
01173 ; .line 520; "serial1.c" computeCRC(c);
025A 0000 0000 01174 BANKSEL r0x1014
025C 0800 01175 MOVF r0x1014,W
025D 2000 01176 CALL _computeCRC
01177 ; .line 521; "serial1.c" uartState = SNAP_haveDAB;
025E 3034 01178 MOVLW 0x34
025F 0000 0000 01179 BANKSEL _uartState
0261 0080 01180 MOVWF _uartState
01181 ; .line 523; "serial1.c" break;
0262 2800 01182 GOTO _00204_DS_
0263 01183 _00180_DS_
01184 ; .line 535; "serial1.c" if (serialStatus & processingLockBit) {
0263 0000 0000 01185 BANKSEL _serialStatus
gpasm-0.13.4 beta serial1.asm 6-13-2008 14:34:00 PAGE 23
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
0265 1F80 01186 BTFSS _serialStatus,7
0266 2800 01187 GOTO _00182_DS_
01188 ; .line 537; "serial1.c" uartTransmit(SNAP_SYNC);
0267 3054 01189 MOVLW 0x54
0268 0000 01190 PAGESEL _uartTransmit
0269 2000 01191 CALL _uartTransmit
026A 0000 01192 PAGESEL $
01193 ; .line 538; "serial1.c" crc = 0;
026B 0000 0000 01194 BANKSEL _crc
026D 0180 01195 CLRF _crc
01196 ; .line 539; "serial1.c" uartTransmit(computeCRC(BIN(01010011))); //HDB2
026E 3053 01197 MOVLW 0x53
026F 2000 01198 CALL _computeCRC
0270 0000 0000 01199 BANKSEL r0x1015
0272 0080 01200 MOVWF r0x1015
0273 0000 01201 PAGESEL _uartTransmit
0274 2000 01202 CALL _uartTransmit
0275 0000 01203 PAGESEL $
01204 ; .line 541; "serial1.c" uartTransmit(computeCRC(BIN(00110000))); //HDB1
0276 3030 01205 MOVLW 0x30
0277 2000 01206 CALL _computeCRC
0278 0000 0000 01207 BANKSEL r0x1015
027A 0080 01208 MOVWF r0x1015
027B 0000 01209 PAGESEL _uartTransmit
027C 2000 01210 CALL _uartTransmit
027D 0000 01211 PAGESEL $
01212 ; .line 542; "serial1.c" uartTransmit(computeCRC(sourceAddress)); // Return to sender
027E 0000 0000 01213 BANKSEL _sourceAddress
0280 0800 01214 MOVF _sourceAddress,W
0281 2000 01215 CALL _computeCRC
0282 0000 0000 01216 BANKSEL r0x1015
0284 0080 01217 MOVWF r0x1015
0285 0000 01218 PAGESEL _uartTransmit
0286 2000 01219 CALL _uartTransmit
0287 0000 01220 PAGESEL $
01221 ; .line 543; "serial1.c" uartTransmit(computeCRC(deviceAddress)); // From us
0288 0000 0000 01222 BANKSEL _deviceAddress
028A 0800 01223 MOVF _deviceAddress,W
028B 2000 01224 CALL _computeCRC
028C 0000 0000 01225 BANKSEL r0x1015
028E 0080 01226 MOVWF r0x1015
028F 0000 01227 PAGESEL _uartTransmit
0290 2000 01228 CALL _uartTransmit
0291 0000 01229 PAGESEL $
01230 ; .line 551; "serial1.c" uartTransmit(crc); // CRC
0292 0000 0000 01231 BANKSEL _crc
0294 0800 01232 MOVF _crc,W
0295 0000 01233 PAGESEL _uartTransmit
0296 2000 01234 CALL _uartTransmit
0297 0000 01235 PAGESEL $
01236 ; .line 552; "serial1.c" serialStatus &= ~ackRequestedBit; //clear
0298 0000 0000 01237 BANKSEL _serialStatus
029A 1300 01238 BCF _serialStatus,6
01239 ; .line 553; "serial1.c" serialStatus |= msgAbortedBit; //set
gpasm-0.13.4 beta serial1.asm 6-13-2008 14:34:00 PAGE 24
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
029B 1580 01240 BSF _serialStatus,3
01241 ; .line 554; "serial1.c" uartState = SNAP_idle;
029C 3030 01242 MOVLW 0x30
029D 0000 0000 01243 BANKSEL _uartState
029F 0080 01244 MOVWF _uartState
02A0 2800 01245 GOTO _00204_DS_
02A1 01246 _00182_DS_
01247 ; .line 556; "serial1.c" sourceAddress = c;
02A1 0000 0000 01248 BANKSEL r0x1014
02A3 0800 01249 MOVF r0x1014,W
02A4 0000 0000 01250 BANKSEL _sourceAddress
02A6 0080 01251 MOVWF _sourceAddress
01252 ; .line 557; "serial1.c" bufferIndex = 0;
02A7 0000 0000 01253 BANKSEL _bufferIndex
02A9 0180 01254 CLRF _bufferIndex
01255 ; .line 558; "serial1.c" computeCRC(c);
02AA 0000 0000 01256 BANKSEL r0x1014
02AC 0800 01257 MOVF r0x1014,W
02AD 2000 01258 CALL _computeCRC
01259 ; .line 559; "serial1.c" uartState = SNAP_readingData;
02AE 3035 01260 MOVLW 0x35
02AF 0000 0000 01261 BANKSEL _uartState
02B1 0080 01262 MOVWF _uartState
01263 ; .line 561; "serial1.c" break;
02B2 2800 01264 GOTO _00204_DS_
02B3 01265 _00184_DS_
01266 ; .line 565; "serial1.c" buffer[bufferIndex] = c;
02B3 0000 0000 01267 BANKSEL _bufferIndex
02B5 0800 01268 MOVF _bufferIndex,W
02B6 3E00 01269 ADDLW (_buffer + 0)
02B7 0000 0000 01270 BANKSEL r0x1015
02B9 0080 01271 MOVWF r0x1015
02BA 3000 01272 MOVLW high (_buffer + 0)
02BB 1803 01273 BTFSC STATUS,0
02BC 3E01 01274 ADDLW 0x01
02BD 0080 01275 MOVWF r0x1016
02BE 0800 01276 MOVF r0x1015,W
02BF 0084 01277 MOVWF FSR
02C0 1383 01278 BCF STATUS,7
02C1 1800 01279 BTFSC r0x1016,0
02C2 1783 01280 BSF STATUS,7
02C3 0800 01281 MOVF r0x1014,W
02C4 0080 01282 MOVWF INDF
01283 ; .line 566; "serial1.c" bufferIndex++;
02C5 0000 0000 01284 BANKSEL _bufferIndex
02C7 0A80 01285 INCF _bufferIndex,F
01286 ; .line 567; "serial1.c" computeCRC(c);
02C8 0000 0000 01287 BANKSEL r0x1014
02CA 0800 01288 MOVF r0x1014,W
02CB 2000 01289 CALL _computeCRC
01290 ; .line 569; "serial1.c" if (bufferIndex == packetLength)
02CC 0000 0000 01291 BANKSEL _packetLength
02CE 0800 01292 MOVF _packetLength,W
02CF 0000 0000 01293 BANKSEL _bufferIndex
gpasm-0.13.4 beta serial1.asm 6-13-2008 14:34:00 PAGE 25
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
02D1 0600 01294 XORWF _bufferIndex,W
02D2 1D03 01295 BTFSS STATUS,2
02D3 2800 01296 GOTO _00204_DS_
01297 ; .line 570; "serial1.c" uartState = SNAP_dataComplete;
02D4 3036 01298 MOVLW 0x36
02D5 0000 0000 01299 BANKSEL _uartState
02D7 0080 01300 MOVWF _uartState
01301 ; .line 571; "serial1.c" break;
02D8 2800 01302 GOTO _00204_DS_
02D9 01303 _00187_DS_
01304 ; .line 580; "serial1.c" if (c == crc) {
02D9 0000 0000 01305 BANKSEL _crc
02DB 0800 01306 MOVF _crc,W
02DC 0000 0000 01307 BANKSEL r0x1014
02DE 0600 01308 XORWF r0x1014,W
02DF 1D03 01309 BTFSS STATUS,2
02E0 2800 01310 GOTO _00189_DS_
01311 ; .line 588; "serial1.c" hdb2 |= BIN(10);
02E1 3052 01312 MOVLW 0x52
02E2 0080 01313 MOVWF r0x1015
01314 ; .line 589; "serial1.c" serialStatus |= processingLockBit; //set processingLockBit
02E3 0000 0000 01315 BANKSEL _serialStatus
02E5 1780 01316 BSF _serialStatus,7
01317 ; .line 590; "serial1.c" receivedSourceAddress = sourceAddress;
02E6 0000 0000 01318 BANKSEL _sourceAddress
02E8 0800 01319 MOVF _sourceAddress,W
02E9 0000 0000 01320 BANKSEL _receivedSourceAddress
02EB 0080 01321 MOVWF _receivedSourceAddress
02EC 2800 01322 GOTO _00190_DS_
02ED 01323 _00189_DS_
01324 ; .line 593; "serial1.c" hdb2 |= BIN(11);
02ED 3053 01325 MOVLW 0x53
02EE 0000 0000 01326 BANKSEL r0x1015
02F0 0080 01327 MOVWF r0x1015
02F1 01328 _00190_DS_
01329 ; .line 595; "serial1.c" if (serialStatus & ackRequestedBit) {
02F1 0000 0000 01330 BANKSEL _serialStatus
02F3 1F00 01331 BTFSS _serialStatus,6
02F4 2800 01332 GOTO _00192_DS_
01333 ; .line 597; "serial1.c" uartTransmit(SNAP_SYNC);
02F5 3054 01334 MOVLW 0x54
02F6 0000 01335 PAGESEL _uartTransmit
02F7 2000 01336 CALL _uartTransmit
02F8 0000 01337 PAGESEL $
01338 ; .line 598; "serial1.c" crc = 0;
02F9 0000 0000 01339 BANKSEL _crc
02FB 0180 01340 CLRF _crc
01341 ; .line 599; "serial1.c" uartTransmit(computeCRC(hdb2));
02FC 0000 0000 01342 BANKSEL r0x1015
02FE 0800 01343 MOVF r0x1015,W
02FF 2000 01344 CALL _computeCRC
0300 0000 0000 01345 BANKSEL r0x1015
0302 0080 01346 MOVWF r0x1015
0303 0000 01347 PAGESEL _uartTransmit
gpasm-0.13.4 beta serial1.asm 6-13-2008 14:34:00 PAGE 26
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
0304 2000 01348 CALL _uartTransmit
0305 0000 01349 PAGESEL $
01350 ; .line 601; "serial1.c" uartTransmit(computeCRC(BIN(00110000)));
0306 3030 01351 MOVLW 0x30
0307 2000 01352 CALL _computeCRC
0308 0000 0000 01353 BANKSEL r0x1015
030A 0080 01354 MOVWF r0x1015
030B 0000 01355 PAGESEL _uartTransmit
030C 2000 01356 CALL _uartTransmit
030D 0000 01357 PAGESEL $
01358 ; .line 602; "serial1.c" uartTransmit(computeCRC(sourceAddress)); // Return to sender
030E 0000 0000 01359 BANKSEL _sourceAddress
0310 0800 01360 MOVF _sourceAddress,W
0311 2000 01361 CALL _computeCRC
0312 0000 0000 01362 BANKSEL r0x1015
0314 0080 01363 MOVWF r0x1015
0315 0000 01364 PAGESEL _uartTransmit
0316 2000 01365 CALL _uartTransmit
0317 0000 01366 PAGESEL $
01367 ; .line 603; "serial1.c" uartTransmit(computeCRC(deviceAddress)); // From us
0318 0000 0000 01368 BANKSEL _deviceAddress
031A 0800 01369 MOVF _deviceAddress,W
031B 2000 01370 CALL _computeCRC
031C 0000 0000 01371 BANKSEL r0x1015
031E 0080 01372 MOVWF r0x1015
031F 0000 01373 PAGESEL _uartTransmit
0320 2000 01374 CALL _uartTransmit
0321 0000 01375 PAGESEL $
01376 ; .line 604; "serial1.c" uartTransmit(crc); // CRC
0322 0000 0000 01377 BANKSEL _crc
0324 0800 01378 MOVF _crc,W
0325 0000 01379 PAGESEL _uartTransmit
0326 2000 01380 CALL _uartTransmit
0327 0000 01381 PAGESEL $
01382 ; .line 605; "serial1.c" serialStatus &= ~ackRequestedBit; //clear
0328 0000 0000 01383 BANKSEL _serialStatus
032A 1300 01384 BCF _serialStatus,6
032B 01385 _00192_DS_
01386 ; .line 608; "serial1.c" uartState = SNAP_idle;
032B 3030 01387 MOVLW 0x30
032C 0000 0000 01388 BANKSEL _uartState
032E 0080 01389 MOVWF _uartState
01390 ; .line 609; "serial1.c" break;
032F 2800 01391 GOTO _00204_DS_
0330 01392 _00193_DS_
01393 ; .line 613; "serial1.c" uartTransmit(c); // We will be reading HDB1; pass it on
0330 0000 0000 01394 BANKSEL r0x1014
0332 0800 01395 MOVF r0x1014,W
0333 0000 01396 PAGESEL _uartTransmit
0334 2000 01397 CALL _uartTransmit
0335 0000 01398 PAGESEL $
01399 ; .line 614; "serial1.c" packetLength = c & 0x0f;
0336 300F 01400 MOVLW 0x0f
0337 0000 0000 01401 BANKSEL r0x1014
gpasm-0.13.4 beta serial1.asm 6-13-2008 14:34:00 PAGE 27
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
0339 0500 01402 ANDWF r0x1014,W
033A 0000 0000 01403 BANKSEL _packetLength
033C 0080 01404 MOVWF _packetLength
01405 ;swapping arguments (AOP_TYPEs 1/3)
01406 ;unsigned compare: left >= lit(0x11=17), size=1
01407 ; .line 615; "serial1.c" if (packetLength > MAX_PAYLOAD)
033D 3011 01408 MOVLW 0x11
033E 0200 01409 SUBWF _packetLength,W
033F 1C03 01410 BTFSS STATUS,0
0340 2800 01411 GOTO _00195_DS_
01412 ;genSkipc:3694: created from rifx:0xbffdc340
01413 ; .line 616; "serial1.c" packetLength = MAX_PAYLOAD;
0341 3010 01414 MOVLW 0x10
0342 0080 01415 MOVWF _packetLength
0343 01416 _00195_DS_
01417 ; .line 617; "serial1.c" uartState = SNAP_haveHDB1Pass;
0343 3038 01418 MOVLW 0x38
0344 0000 0000 01419 BANKSEL _uartState
0346 0080 01420 MOVWF _uartState
01421 ; .line 618; "serial1.c" break;
0347 2800 01422 GOTO _00204_DS_
0348 01423 _00196_DS_
01424 ; .line 622; "serial1.c" uartTransmit(c); // We will be reading dest addr; pass it on
0348 0000 0000 01425 BANKSEL r0x1014
034A 0800 01426 MOVF r0x1014,W
034B 0000 01427 PAGESEL _uartTransmit
034C 2000 01428 CALL _uartTransmit
034D 0000 01429 PAGESEL $
01430 ; .line 623; "serial1.c" uartState = SNAP_haveDABPass;
034E 3039 01431 MOVLW 0x39
034F 0000 0000 01432 BANKSEL _uartState
0351 0080 01433 MOVWF _uartState
01434 ; .line 624; "serial1.c" break;
0352 2800 01435 GOTO _00204_DS_
0353 01436 _00197_DS_
01437 ; .line 628; "serial1.c" uartTransmit(c); // We will be reading source addr; pass it on
0353 0000 0000 01438 BANKSEL r0x1014
0355 0800 01439 MOVF r0x1014,W
0356 0000 01440 PAGESEL _uartTransmit
0357 2000 01441 CALL _uartTransmit
0358 0000 01442 PAGESEL $
01443 ; .line 632; "serial1.c" packetLength++;
0359 0000 0000 01444 BANKSEL _packetLength
035B 0A80 01445 INCF _packetLength,F
01446 ; .line 634; "serial1.c" uartState = SNAP_readingDataPass;
035C 303A 01447 MOVLW 0x3a
035D 0000 0000 01448 BANKSEL _uartState
035F 0080 01449 MOVWF _uartState
01450 ; .line 635; "serial1.c" break;
0360 2800 01451 GOTO _00204_DS_
0361 01452 _00198_DS_
01453 ; .line 639; "serial1.c" uartTransmit(c); // This is a data byte; pass it on
0361 0000 0000 01454 BANKSEL r0x1014
0363 0800 01455 MOVF r0x1014,W
gpasm-0.13.4 beta serial1.asm 6-13-2008 14:34:00 PAGE 28
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
0364 0000 01456 PAGESEL _uartTransmit
0365 2000 01457 CALL _uartTransmit
0366 0000 01458 PAGESEL $
01459 ;swapping arguments (AOP_TYPEs 1/3)
01460 ;unsigned compare: left >= lit(0x2=2), size=1
01461 ; .line 640; "serial1.c" if (packetLength > 1)
0367 3002 01462 MOVLW 0x02
0368 0000 0000 01463 BANKSEL _packetLength
036A 0200 01464 SUBWF _packetLength,W
036B 1C03 01465 BTFSS STATUS,0
036C 2800 01466 GOTO _00200_DS_
01467 ;genSkipc:3694: created from rifx:0xbffdc340
01468 ; .line 641; "serial1.c" packetLength--;
036D 0380 01469 DECF _packetLength,F
036E 2800 01470 GOTO _00204_DS_
036F 01471 _00200_DS_
01472 ; .line 643; "serial1.c" uartState = SNAP_idle;
036F 3030 01473 MOVLW 0x30
0370 0000 0000 01474 BANKSEL _uartState
0372 0080 01475 MOVWF _uartState
01476 ; .line 644; "serial1.c" serialStatus &= ~inTransmitMsgBit; //clear
0373 0000 0000 01477 BANKSEL _serialStatus
0375 1080 01478 BCF _serialStatus,1
01479 ; .line 646; "serial1.c" break;
0376 2800 01480 GOTO _00204_DS_
0377 01481 _00202_DS_
01482 ; .line 649; "serial1.c" serialStatus |= serialErrorBit; //set serialError
0377 0000 0000 01483 BANKSEL _serialStatus
0379 1400 01484 BSF _serialStatus,0
01485 ; .line 650; "serial1.c" serialStatus |= wrongStateErrorBit;
037A 1600 01486 BSF _serialStatus,4
01487 ; .line 651; "serial1.c" uartReceiveError();
037B 2000 01488 CALL _uartReceiveError
037C 01489 _00204_DS_
01490 ; .line 652; "serial1.c" }
037C 0008 01491 RETURN
01492 ; exit point of _uartNotifyReceive
01493
01494 ;***
01495 ; pBlock Stats: dbName = C
01496 ;***
01497 ;entry: _uartReceiveError ;Function start
01498 ; 2 exit points
01499 ;has an exit
01500 ;functions called:
01501 ; _uartTransmit
01502 ; _uartTransmit
01503 ;1 compiler assigned register :
01504 ; r0x1017
01505 ;; Starting pCode block
037D 01506 _uartReceiveError ;Function start
01507 ; 2 exit points
01508 ; .line 404; "serial1.c" if ((serialStatus & msgAbortedBit) == 0) {
037D 0000 0000 01509 BANKSEL _serialStatus
gpasm-0.13.4 beta serial1.asm 6-13-2008 14:34:00 PAGE 29
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
037F 1980 01510 BTFSC _serialStatus,3
0380 2800 01511 GOTO _00148_DS_
01512 ; .line 406; "serial1.c" for (i=0; i<8; i++) { //if we are sending too much for the transmit-buffer, it is discarded
0381 3008 01513 MOVLW 0x08
0382 0000 0000 01514 BANKSEL r0x1017
0384 0080 01515 MOVWF r0x1017
0385 01516 _00151_DS_
01517 ; .line 407; "serial1.c" uartTransmit(0);
0385 3000 01518 MOVLW 0x00
0386 0000 01519 PAGESEL _uartTransmit
0387 2000 01520 CALL _uartTransmit
0388 0000 01521 PAGESEL $
0389 0000 0000 01522 BANKSEL r0x1017
038B 0B80 01523 DECFSZ r0x1017,F
038C 2800 01524 GOTO _00151_DS_
038D 01525 _00148_DS_
01526 ; .line 420; "serial1.c" serialStatus = (serialStatus & msgAbortedBit); //clear all bits except msgAbortedBit;
038D 3008 01527 MOVLW 0x08
038E 0000 0000 01528 BANKSEL _serialStatus
0390 0580 01529 ANDWF _serialStatus,F
01530 ; .line 422; "serial1.c" uartState = SNAP_idle;
0391 3030 01531 MOVLW 0x30
0392 0000 0000 01532 BANKSEL _uartState
0394 0080 01533 MOVWF _uartState
0395 0008 01534 RETURN
01535 ; exit point of _uartReceiveError
01536
01537 ;***
01538 ; pBlock Stats: dbName = C
01539 ;***
01540 ;entry: _computeCRC ;Function start
01541 ; 2 exit points
01542 ;has an exit
01543 ;2 compiler assigned registers:
01544 ; r0x1017
01545 ; r0x1018
01546 ;; Starting pCode block
0396 01547 _computeCRC ;Function start
01548 ; 2 exit points
01549 ; .line 338; "serial1.c" byte computeCRC(byte dataval)
0396 0000 0000 01550 BANKSEL r0x1017
0398 0080 01551 MOVWF r0x1017
01552 ; .line 369; "serial1.c" byte i = dataval ^ crc;
0399 0000 0000 01553 BANKSEL _crc
039B 0600 01554 XORWF _crc,W
039C 0000 0000 01555 BANKSEL r0x1018
039E 0080 01556 MOVWF r0x1018
01557 ; .line 371; "serial1.c" crc = 0;
039F 0000 0000 01558 BANKSEL _crc
03A1 0180 01559 CLRF _crc
01560 ; .line 373; "serial1.c" if(i & 1)
03A2 0000 0000 01561 BANKSEL r0x1018
03A4 1C00 01562 BTFSS r0x1018,0
03A5 2800 01563 GOTO _00128_DS_
gpasm-0.13.4 beta serial1.asm 6-13-2008 14:34:00 PAGE 30
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
01564 ; .line 374; "serial1.c" crc ^= 0x5e;
03A6 305E 01565 MOVLW 0x5e
03A7 0000 0000 01566 BANKSEL _crc
03A9 0680 01567 XORWF _crc,F
03AA 01568 _00128_DS_
01569 ; .line 375; "serial1.c" if(i & 2)
03AA 0000 0000 01570 BANKSEL r0x1018
03AC 1C80 01571 BTFSS r0x1018,1
03AD 2800 01572 GOTO _00130_DS_
01573 ; .line 376; "serial1.c" crc ^= 0xbc;
03AE 30BC 01574 MOVLW 0xbc
03AF 0000 0000 01575 BANKSEL _crc
03B1 0680 01576 XORWF _crc,F
03B2 01577 _00130_DS_
01578 ; .line 377; "serial1.c" if(i & 4)
03B2 0000 0000 01579 BANKSEL r0x1018
03B4 1D00 01580 BTFSS r0x1018,2
03B5 2800 01581 GOTO _00132_DS_
01582 ; .line 378; "serial1.c" crc ^= 0x61;
03B6 3061 01583 MOVLW 0x61
03B7 0000 0000 01584 BANKSEL _crc
03B9 0680 01585 XORWF _crc,F
03BA 01586 _00132_DS_
01587 ; .line 379; "serial1.c" if(i & 8)
03BA 0000 0000 01588 BANKSEL r0x1018
03BC 1D80 01589 BTFSS r0x1018,3
03BD 2800 01590 GOTO _00134_DS_
01591 ; .line 380; "serial1.c" crc ^= 0xc2;
03BE 30C2 01592 MOVLW 0xc2
03BF 0000 0000 01593 BANKSEL _crc
03C1 0680 01594 XORWF _crc,F
03C2 01595 _00134_DS_
01596 ; .line 381; "serial1.c" if(i & 0x10)
03C2 0000 0000 01597 BANKSEL r0x1018
03C4 1E00 01598 BTFSS r0x1018,4
03C5 2800 01599 GOTO _00136_DS_
01600 ; .line 382; "serial1.c" crc ^= 0x9d;
03C6 309D 01601 MOVLW 0x9d
03C7 0000 0000 01602 BANKSEL _crc
03C9 0680 01603 XORWF _crc,F
03CA 01604 _00136_DS_
01605 ; .line 383; "serial1.c" if(i & 0x20)
03CA 0000 0000 01606 BANKSEL r0x1018
03CC 1E80 01607 BTFSS r0x1018,5
03CD 2800 01608 GOTO _00138_DS_
01609 ; .line 384; "serial1.c" crc ^= 0x23;
03CE 3023 01610 MOVLW 0x23
03CF 0000 0000 01611 BANKSEL _crc
03D1 0680 01612 XORWF _crc,F
03D2 01613 _00138_DS_
01614 ; .line 385; "serial1.c" if(i & 0x40)
03D2 0000 0000 01615 BANKSEL r0x1018
03D4 1F00 01616 BTFSS r0x1018,6
03D5 2800 01617 GOTO _00140_DS_
gpasm-0.13.4 beta serial1.asm 6-13-2008 14:34:00 PAGE 31
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
01618 ; .line 386; "serial1.c" crc ^= 0x46;
03D6 3046 01619 MOVLW 0x46
03D7 0000 0000 01620 BANKSEL _crc
03D9 0680 01621 XORWF _crc,F
03DA 01622 _00140_DS_
01623 ; .line 387; "serial1.c" if(i & 0x80)
03DA 0000 0000 01624 BANKSEL r0x1018
03DC 1F80 01625 BTFSS r0x1018,7
03DD 2800 01626 GOTO _00142_DS_
01627 ; .line 388; "serial1.c" crc ^= 0x8c;
03DE 308C 01628 MOVLW 0x8c
03DF 0000 0000 01629 BANKSEL _crc
03E1 0680 01630 XORWF _crc,F
03E2 01631 _00142_DS_
01632 ; .line 389; "serial1.c" return dataval;
03E2 0000 0000 01633 BANKSEL r0x1017
03E4 0800 01634 MOVF r0x1017,W
03E5 0008 01635 RETURN
01636 ; exit point of _computeCRC
01637
01638 ;***
01639 ; pBlock Stats: dbName = C
01640 ;***
01641 ;entry: _serial_init ;Function start
01642 ; 2 exit points
01643 ;has an exit
01644 ;; Starting pCode block
03E6 01645 _serial_init ;Function start
01646 ; 2 exit points
01647 ; .line 324; "serial1.c" uartState = SNAP_idle;
03E6 3030 01648 MOVLW 0x30
03E7 0000 0000 01649 BANKSEL _uartState
03E9 0080 01650 MOVWF _uartState
01651 ; .line 325; "serial1.c" transmitBufferHead = 0;
03EA 0000 0000 01652 BANKSEL _transmitBufferHead
03EC 0180 01653 CLRF _transmitBufferHead
01654 ; .line 326; "serial1.c" transmitBufferTail = 0;
03ED 0000 0000 01655 BANKSEL _transmitBufferTail
03EF 0180 01656 CLRF _transmitBufferTail
01657 ; .line 327; "serial1.c" serialStatus = 0;
03F0 0000 0000 01658 BANKSEL _serialStatus
03F2 0180 01659 CLRF _serialStatus
01660 ; .line 328; "serial1.c" crc = 0;
03F3 0000 0000 01661 BANKSEL _crc
03F5 0180 01662 CLRF _crc
01663 ; .line 329; "serial1.c" flash = 0;
03F6 0000 0000 01664 BANKSEL _flash
03F8 0180 01665 CLRF _flash
01666 ; .line 330; "serial1.c" flashON = FLASHRATE;
03F9 3032 01667 MOVLW 0x32
01668 ; .line 331; "serial1.c" flashOFF = FLASHRATE;
03FA 0000 0000 01669 BANKSEL _flashON
03FC 0080 01670 MOVWF _flashON
03FD 0000 0000 01671 BANKSEL _flashOFF
gpasm-0.13.4 beta serial1.asm 6-13-2008 14:34:00 PAGE 32
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
03FF 0080 01672 MOVWF _flashOFF
0400 0008 01673 RETURN
01674 ; exit point of _serial_init
01675
01676 ;***
01677 ; pBlock Stats: dbName = C
01678 ;***
01679 ;entry: _setFlash ;Function start
01680 ; 2 exit points
01681 ;has an exit
01682 ;1 compiler assigned register :
01683 ; STK00
01684 ;; Starting pCode block
0401 01685 _setFlash ;Function start
01686 ; 2 exit points
01687 ; .line 313; "serial1.c" void setFlash(byte on, byte off)
0401 0000 0000 01688 BANKSEL _flashON
0403 0080 01689 MOVWF _flashON
0404 0800 01690 MOVF STK00,W
0405 0000 0000 01691 BANKSEL _flashOFF
0407 0080 01692 MOVWF _flashOFF
01693 ; .line 316; "serial1.c" flashOFF = off;
0408 0008 01694 RETURN
01695 ; exit point of _setFlash
01696
01697 ;***
01698 ; pBlock Stats: dbName = C
01699 ;***
01700 ;entry: _LEDon ;Function start
01701 ; 2 exit points
01702 ;has an exit
01703 ;; Starting pCode block
0409 01704 _LEDon ;Function start
01705 ; 2 exit points
01706 ; .line 310; "serial1.c" LED = 0;
0409 0000 0000 01707 BANKSEL _PORTA_bits
040B 1200 01708 BCF _PORTA_bits,4
040C 0008 01709 RETURN
01710 ; exit point of _LEDon
01711
01712 ;***
01713 ; pBlock Stats: dbName = C
01714 ;***
01715 ;entry: _flashLED ;Function start
01716 ; 2 exit points
01717 ;has an exit
01718 ;; Starting pCode block
040D 01719 _flashLED ;Function start
01720 ; 2 exit points
01721 ; .line 292; "serial1.c" flash_count--;
040D 0000 0000 01722 BANKSEL _flash_count
040F 0380 01723 DECF _flash_count,F
01724 ; .line 293; "serial1.c" if(flash_count <= 0)
0410 0800 01725 MOVF _flash_count,W
gpasm-0.13.4 beta serial1.asm 6-13-2008 14:34:00 PAGE 33
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
0411 1D03 01726 BTFSS STATUS,2
0412 2800 01727 GOTO _00110_DS_
01728 ; .line 295; "serial1.c" flash = 1 - flash;
0413 0000 0000 01729 BANKSEL _flash
0415 0800 01730 MOVF _flash,W
0416 3C01 01731 SUBLW 0x01
0417 0080 01732 MOVWF _flash
01733 ; .line 296; "serial1.c" if(flash)
0418 0800 01734 MOVF _flash,W
0419 1903 01735 BTFSC STATUS,2
041A 2800 01736 GOTO _00106_DS_
01737 ; .line 298; "serial1.c" LED = 0;
041B 0000 0000 01738 BANKSEL _PORTA_bits
041D 1200 01739 BCF _PORTA_bits,4
01740 ; .line 299; "serial1.c" flash_count = flashOFF;
041E 0000 0000 01741 BANKSEL _flashOFF
0420 0800 01742 MOVF _flashOFF,W
0421 0000 0000 01743 BANKSEL _flash_count
0423 0080 01744 MOVWF _flash_count
0424 2800 01745 GOTO _00110_DS_
0425 01746 _00106_DS_
01747 ; .line 302; "serial1.c" LED = 1;
0425 0000 0000 01748 BANKSEL _PORTA_bits
0427 1600 01749 BSF _PORTA_bits,4
01750 ; .line 303; "serial1.c" flash_count = flashON;
0428 0000 0000 01751 BANKSEL _flashON
042A 0800 01752 MOVF _flashON,W
042B 0000 0000 01753 BANKSEL _flash_count
042D 0080 01754 MOVWF _flash_count
042E 01755 _00110_DS_
042E 0008 01756 RETURN
01757 ; exit point of _flashLED
01758
01759
01760 ; code size estimation:
01761 ; 569+ 279 = 848 instructions ( 2254 byte)
01762
gpasm-0.13.4 beta serial1.asm 6-13-2008 14:34:00 PAGE 34
SYMBOL TABLE
LABEL VALUE
ADEN 00000003
BRGH 00000002
C 00000000
C1INV 00000004
C1OUT 00000006
C2INV 00000005
C2OUT 00000007
CCP1CON 00000017
CCP1IE 00000002
CCP1IF 00000002
CCP1M0 00000000
CCP1M1 00000001
CCP1M2 00000002
CCP1M3 00000003
CCP1X 00000005
CCP1Y 00000004
CCPR1H 00000016
CCPR1L 00000015
CIS 00000003
CM0 00000000
CM1 00000001
CM2 00000002
CMCON 0000001F
CMIE 00000006
CMIF 00000006
CREN 00000004
CSRC 00000007
DC 00000001
EEADR 0000009B
EECON1 0000009C
EECON2 0000009D
EEDATA 0000009A
EEIE 00000007
EEIF 00000007
F 00000001
FERR 00000002
FSR 00000004
GIE 00000007
INDF 00000000
INTCON 0000000B
INTE 00000004
INTEDG 00000006
INTF 00000001
IRP 00000007
NOT_BO 00000000
NOT_BOD 00000000
NOT_BOR 00000000
NOT_PD 00000003
NOT_POR 00000001
NOT_RBPU 00000007
NOT_T1SYNC 00000002
NOT_TO 00000004
OERR 00000001
gpasm-0.13.4 beta serial1.asm 6-13-2008 14:34:00 PAGE 35
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
OPTION_REG 00000081
OSCF 00000003
PCL 00000002
PCLATH 0000000A
PCON 0000008E
PEIE 00000006
PIE1 0000008C
PIR1 0000000C
PORTA 00000005
PORTB 00000006
PR2 00000092
PS0 00000000
PS1 00000001
PS2 00000002
PSA 00000003
PSAVE 00000000
RBIE 00000003
RBIF 00000000
RCIE 00000005
RCIF 00000005
RCREG 0000001A
RCSTA 00000018
RD 00000000
RP0 00000005
RP1 00000006
RX9 00000006
RX9D 00000000
SPBRG 00000099
SPEN 00000007
SREN 00000005
SSAVE 00000000
STATUS 00000003
STK00 00000000
STK01 00000000
STK02 00000000
STK03 00000000
STK04 00000000
STK05 00000000
STK06 00000000
STK07 00000000
STK08 00000000
STK09 00000000
STK10 00000000
STK11 00000000
STK12 00000000
SYNC 00000004
T0CS 00000005
T0IE 00000005
T0IF 00000002
T0SE 00000004
T1CKPS0 00000004
T1CKPS1 00000005
T1CON 00000010
T1OSCEN 00000003
gpasm-0.13.4 beta serial1.asm 6-13-2008 14:34:00 PAGE 36
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
T2CKPS0 00000000
T2CKPS1 00000001
T2CON 00000012
TMR0 00000001
TMR1CS 00000001
TMR1H 0000000F
TMR1IE 00000000
TMR1IF 00000000
TMR1L 0000000E
TMR1ON 00000000
TMR2 00000011
TMR2IE 00000001
TMR2IF 00000001
TMR2ON 00000002
TOUTPS0 00000003
TOUTPS1 00000004
TOUTPS2 00000005
TOUTPS3 00000006
TRISA 00000085
TRISB 00000086
TRMT 00000001
TX9 00000006
TX9D 00000000
TXEN 00000005
TXIE 00000004
TXIF 00000004
TXREG 00000019
TXSTA 00000098
VR0 00000000
VR1 00000001
VR2 00000002
VR3 00000003
VRCON 0000009F
VREN 00000007
VROE 00000006
VRR 00000005
W 00000000
WR 00000001
WREN 00000002
WRERR 00000003
WSAVE 00000000
Z 00000002
_00001_DS_ 000000C6
_00106_DS_ 00000425
_00110_DS_ 0000042E
_00128_DS_ 000003AA
_00130_DS_ 000003B2
_00132_DS_ 000003BA
_00134_DS_ 000003C2
_00136_DS_ 000003CA
_00138_DS_ 000003D2
_00140_DS_ 000003DA
_00142_DS_ 000003E2
_00148_DS_ 0000038D
gpasm-0.13.4 beta serial1.asm 6-13-2008 14:34:00 PAGE 37
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
_00151_DS_ 00000385
_00159_DS_ 000001A8
_00160_DS_ 000001CC
_00163_DS_ 000001DA
_00165_DS_ 000001FA
_00166_DS_ 000001FD
_00168_DS_ 000001EE
_00170_DS_ 00000209
_00172_DS_ 0000022A
_00174_DS_ 0000021D
_00176_DS_ 00000233
_00178_DS_ 0000025A
_00180_DS_ 00000263
_00182_DS_ 000002A1
_00184_DS_ 000002B3
_00187_DS_ 000002D9
_00189_DS_ 000002ED
_00190_DS_ 000002F1
_00192_DS_ 0000032B
_00193_DS_ 00000330
_00195_DS_ 00000343
_00196_DS_ 00000348
_00197_DS_ 00000353
_00198_DS_ 00000361
_00200_DS_ 0000036F
_00202_DS_ 00000377
_00204_DS_ 0000037C
_00224_DS_ 000001C1
_00238_DS_ 00000194
_00253_DS_ 00000161
_00274_DS_ 0000010B
_00275_DS_ 0000010D
_00279_DS_ 00000112
_00288_DS_ 000000D8
_00290_DS_ 000000F2
_00311_DS_ 0000008B
_00314_DS_ 000000A9
_00315_DS_ 000000B0
_00324_DS_ 0000003C
_00326_DS_ 00000056
_00336_DS_ 00000016
_00339_DS_ 00000031
_00342_DS_ 00000036
_BODEN_OFF 00003FBF
_BODEN_ON 00003FFF
_BOREN_OFF 00003FBF
_BOREN_ON 00003FFF
_CCP1CON 00000000
_CCP1CON_bits 00000000
_CCPR1H 00000000
_CCPR1L 00000000
_CMCON 00000000
_CMCON_bits 00000000
_CP_OFF 00003FFF
gpasm-0.13.4 beta serial1.asm 6-13-2008 14:34:00 PAGE 38
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
_CP_ON 00001FFF
_DATA_CP_OFF 00003FFF
_DATA_CP_ON 00003EFF
_EEADR 00000000
_EECON1 00000000
_EECON1_bits 00000000
_EECON2 00000000
_EEDATA 00000000
_ER_OSC_CLKOUT 00003FFF
_ER_OSC_NOCLKOUT 00003FFE
_EXTCLK_OSC 00003FEF
_FSR 00000000
_HS_OSC 00003FEE
_INDF 00000000
_INTCON 00000000
_INTCON_bits 00000000
_INTOSC_OSC_CLKOUT 00003FFD
_INTOSC_OSC_NOCLKOUT 00003FFC
_INTRC_OSC_CLKOUT 00003FFD
_INTRC_OSC_NOCLKOUT 00003FFC
_LEDon 00000409
_LP_OSC 00003FEC
_LVP_OFF 00003F7F
_LVP_ON 00003FFF
_MCLRE_OFF 00003FDF
_MCLRE_ON 00003FFF
_OPTION_REG 00000000
_OPTION_REG_bits 00000000
_PCL 00000000
_PCLATH 00000000
_PCON 00000000
_PCON_bits 00000000
_PIE1 00000000
_PIE1_bits 00000000
_PIR1 00000000
_PIR1_bits 00000000
_PORTA 00000000
_PORTA_bits 00000000
_PORTB 00000000
_PORTB_bits 00000000
_PR2 00000000
_PWRTE_OFF 00003FFF
_PWRTE_ON 00003FF7
_RCREG 00000000
_RCSTA 00000000
_RCSTA_bits 00000000
_RC_OSC_CLKOUT 00003FFF
_RC_OSC_NOCLKOUT 00003FFE
_SPBRG 00000000
_STATUS 00000000
_STATUS_bits 00000000
_T1CON 00000000
_T1CON_bits 00000000
_T2CON 00000000
gpasm-0.13.4 beta serial1.asm 6-13-2008 14:34:00 PAGE 39
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
_T2CON_bits 00000000
_TMR0 00000000
_TMR1H 00000000
_TMR1L 00000000
_TMR2 00000000
_TRISA 00000000
_TRISA_bits 00000000
_TRISB 00000000
_TRISB_bits 00000000
_TXREG 00000000
_TXSTA 00000000
_TXSTA_bits 00000000
_VRCON 00000000
_VRCON_bits 00000000
_WDT_OFF 00003FFB
_WDT_ON 00003FFF
_XT_OSC 00003FED
__16F648A 00000001
_buffer 00000000
_bufferIndex 00000020
_clearwdt 00000000
_code_serial1_000045 00000045
_code_serial1_000048 00000048
_code_serial1_00004b 0000004B
_code_serial1_00004e 0000004E
_code_serial1_000051 00000051
_code_serial1_0000e1 000000E1
_code_serial1_0000e4 000000E4
_code_serial1_0000e7 000000E7
_code_serial1_0000ea 000000EA
_code_serial1_0000ed 000000ED
_code_serial1_00023e 0000023E
_code_serial1_000244 00000244
_code_serial1_00024a 0000024A
_code_serial1_000250 00000250
_code_serial1_00026a 0000026A
_code_serial1_000275 00000275
_code_serial1_00027d 0000027D
_code_serial1_000287 00000287
_code_serial1_000291 00000291
_code_serial1_000297 00000297
_code_serial1_0002f8 000002F8
_code_serial1_000305 00000305
_code_serial1_00030d 0000030D
_code_serial1_000317 00000317
_code_serial1_000321 00000321
_code_serial1_000327 00000327
_code_serial1_000335 00000335
_code_serial1_00034d 0000034D
_code_serial1_000358 00000358
_code_serial1_000366 00000366
_code_serial1_000388 00000388
_computeCRC 00000396
_crc 0000001B
gpasm-0.13.4 beta serial1.asm 6-13-2008 14:34:00 PAGE 40
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
_delay_10us 00000000
_deviceAddress 00000000
_endMessage 00000039
_endMessageISR 0000005B
_endMessageIntern 0000005D
_flash 00000016
_flashLED 0000040D
_flashOFF 00000017
_flashON 00000018
_flash_count 00000015
_in_hdb1 0000001D
_in_hdb2 0000001C
_packetLength 0000001E
_packetReady 000000B1
_receivedSourceAddress 00000021
_releaseLock 00000123
_sendDataByte 0000012F
_sendDataByteISR 0000012D
_sendDataByteIntern 0000013D
_sendMessage 000000D2
_sendMessageISR 000000FA
_sendMessageIntern 00000113
_sendPacket 00000000
_sendPacketDestination 00000023
_sendPacketLength 00000022
_sendReply 000000CD
_serialInterruptHandler 00000000
_serialStatus 00000000
_serial_init 000003E6
_setFlash 00000401
_sourceAddress 0000001F
_transmitBuffer 00000000
_transmitBufferHead 00000019
_transmitBufferTail 0000001A
_uartNotifyReceive 00000197
_uartReceiveError 0000037D
_uartState 00000000
_uartTransmit 00000164
r0x1012 00000013
r0x1013 00000014
r0x1014 00000002
r0x1015 00000003
r0x1016 00000004
r0x1017 00000000
r0x1018 00000001
r0x1019 00000005
r0x101A 00000006
r0x101B 00000007
r0x101C 00000010
r0x101D 00000011
r0x101E 00000012
r0x1020 0000000F
r0x1021 0000000E
r0x1022 0000000C
gpasm-0.13.4 beta serial1.asm 6-13-2008 14:34:00 PAGE 41
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
r0x1023 0000000D
r0x1025 00000008
r0x1026 00000009
r0x1027 0000000A
r0x1028 0000000B
Errors : 0
Warnings : 0 reported, 0 suppressed
Messages : 0 reported, 0 suppressed
|