1
;Program compiled by Great Cow BASIC (0.94 2015-10-27)
2
;Need help? See the GCBASIC forums at http://sourceforge.net/projects/gcbasic/forums,
3
;check the documentation or email w_cholmondeley at users dot sourceforge dot net.
5
;********************************************************************************
7
;Set up the assembler options (Chip type, clock source, other bits and pieces)
9
#include <P18F2550.inc>
10
CONFIG LVP = OFF, MCLRE = OFF, WDT = OFF, FOSC = HS
12
;********************************************************************************
14
;Set aside memory locations for variables
26
SYSSTRINGPARAM1 EQU 2006
44
SysGLCDSTRDATHandler EQU 26
45
SysGLCDSTRDATHandler_H EQU 27
46
SysPRINTDATAHandler EQU 28
47
SysPRINTDATAHandler_H EQU 29
51
SysRepeatTemp3_H EQU 33
55
;********************************************************************************
61
;********************************************************************************
69
;********************************************************************************
71
;Start of program memory page 0
74
;Call initialisation routines
77
;Automatic pin direction setting
86
;Start of the main program
91
movwf SysRepeatTemp1,BANKED
97
lfsr 1,SYSSTRINGPARAM1
98
movlw low StringTable5
100
movlw high StringTable5
103
movlw low SYSSTRINGPARAM1
104
movwf SysPRINTDATAHandler,BANKED
105
movlw high SYSSTRINGPARAM1
106
movwf SysPRINTDATAHandler_H,BANKED
113
movwf SysWaitTempMS,ACCESS
115
movwf SysWaitTempMS_H,ACCESS
121
lfsr 1,SYSSTRINGPARAM1
122
movlw low StringTable6
124
movlw high StringTable6
127
movlw low SYSSTRINGPARAM1
128
movwf SysPRINTDATAHandler,BANKED
129
movlw high SYSSTRINGPARAM1
130
movwf SysPRINTDATAHandler_H,BANKED
137
movwf SysWaitTempMS,ACCESS
139
movwf SysWaitTempMS_H,ACCESS
145
lfsr 1,SYSSTRINGPARAM1
146
movlw low StringTable5
148
movlw high StringTable5
151
movlw low SYSSTRINGPARAM1
152
movwf SysPRINTDATAHandler,BANKED
153
movlw high SYSSTRINGPARAM1
154
movwf SysPRINTDATAHandler_H,BANKED
166
lfsr 1,SYSSTRINGPARAM1
167
movlw low StringTable1
169
movlw high StringTable1
172
movlw low SYSSTRINGPARAM1
173
movwf SysGLCDSTRDATHandler,BANKED
174
movlw high SYSSTRINGPARAM1
175
movwf SysGLCDSTRDATHandler_H,BANKED
178
movwf SysWaitTempMS,ACCESS
180
movwf SysWaitTempMS_H,ACCESS
186
lfsr 1,SYSSTRINGPARAM1
187
movlw low StringTable6
189
movlw high StringTable6
192
movlw low SYSSTRINGPARAM1
193
movwf SysPRINTDATAHandler,BANKED
194
movlw high SYSSTRINGPARAM1
195
movwf SysPRINTDATAHandler_H,BANKED
208
lfsr 1,SYSSTRINGPARAM1
209
movlw low StringTable2
211
movlw high StringTable2
214
movlw low SYSSTRINGPARAM1
215
movwf SysGLCDSTRDATHandler,BANKED
216
movlw high SYSSTRINGPARAM1
217
movwf SysGLCDSTRDATHandler_H,BANKED
220
movwf SysWaitTempMS,ACCESS
222
movwf SysWaitTempMS_H,ACCESS
224
decfsz SysRepeatTemp1,F,BANKED
228
movwf SysWaitTempS,ACCESS
239
movwf SysWaitTempMS,ACCESS
240
clrf SysWaitTempMS_H,ACCESS
245
movwf SysWaitTempMS,ACCESS
246
clrf SysWaitTempMS_H,ACCESS
254
;********************************************************************************
259
btfsc STATUS, C,ACCESS
261
decf DISPLAY,W,BANKED
262
btfss STATUS, Z,ACCESS
268
lfsr 1,SYSSTRINGPARAM1
269
movlw low StringTable6
271
movlw high StringTable6
274
movlw low SYSSTRINGPARAM1
275
movwf SysPRINTDATAHandler,BANKED
276
movlw high SYSSTRINGPARAM1
277
movwf SysPRINTDATAHandler_H,BANKED
286
subwf DISPLAY,W,BANKED
287
btfss STATUS, Z,ACCESS
293
lfsr 1,SYSSTRINGPARAM1
294
movlw low StringTable5
296
movlw high StringTable5
299
movlw low SYSSTRINGPARAM1
300
movwf SysPRINTDATAHandler,BANKED
301
movlw high SYSSTRINGPARAM1
302
movwf SysPRINTDATAHandler_H,BANKED
312
lfsr 1,SYSSTRINGPARAM1
313
movlw low StringTable3
315
movlw high StringTable3
318
movlw low SYSSTRINGPARAM1
319
movwf SysGLCDSTRDATHandler,BANKED
320
movlw high SYSSTRINGPARAM1
321
movwf SysGLCDSTRDATHandler_H,BANKED
324
btfss STATUS, Z,ACCESS
334
btfss STATUS, Z,ACCESS
343
btfss STATUS, Z,ACCESS
349
btfsc STATUS, Z,ACCESS
353
btfss STATUS, Z,ACCESS
359
btfsc STATUS, Z,ACCESS
363
btfsc STATUS, C,ACCESS
368
decf DISPLAY,W,BANKED
369
btfss STATUS, Z,ACCESS
375
lfsr 1,SYSSTRINGPARAM1
376
movlw low StringTable6
378
movlw high StringTable6
381
movlw low SYSSTRINGPARAM1
382
movwf SysPRINTDATAHandler,BANKED
383
movlw high SYSSTRINGPARAM1
384
movwf SysPRINTDATAHandler_H,BANKED
394
subwf DISPLAY,W,BANKED
395
btfss STATUS, Z,ACCESS
401
lfsr 1,SYSSTRINGPARAM1
402
movlw low StringTable5
404
movlw high StringTable5
407
movlw low SYSSTRINGPARAM1
408
movwf SysPRINTDATAHandler,BANKED
409
movlw high SYSSTRINGPARAM1
410
movwf SysPRINTDATAHandler_H,BANKED
420
lfsr 1,SYSSTRINGPARAM1
421
movlw low StringTable4
423
movlw high StringTable4
426
movlw low SYSSTRINGPARAM1
427
movwf SysGLCDSTRDATHandler,BANKED
428
movlw high SYSSTRINGPARAM1
429
movwf SysGLCDSTRDATHandler_H,BANKED
431
lfsr 1,SYSSTRINGPARAM1
432
movlw low StringTable4
434
movlw high StringTable4
437
movlw low SYSSTRINGPARAM1
438
movwf SysPRINTDATAHandler,BANKED
439
movlw high SYSSTRINGPARAM1
440
movwf SysPRINTDATAHandler_H,BANKED
443
;********************************************************************************
447
cpfslt SysStringA,ACCESS
449
movf SysStringA, W,ACCESS
450
addlw low TableASCII_TABLE_H
452
movlw high TableASCII_TABLE_H
453
btfsc STATUS, C,ACCESS
457
movf TABLAT, W,ACCESS
460
db 240,127,9,9,9,6,62,65,81,33,94,127,9,25,41,70,70,73,73,73,49,1,1,127,1,1,63,64
461
db 64,64,63,31,32,64,32,31,63,64,56,64,63,99,20,8,20,99,7,8,112,8,7,97,81,73,69,67
462
db 0,127,65,65,0,2,4,8,16,32,0,65,65,127,0,4,2,1,2,4,64,64,64,64,64,0,1,2,4,0,32,84
463
db 84,84,120,127,72,68,68,56,56,68,68,68,32,56,68,68,72,127,56,84,84,84,24,8,126,9
464
db 1,2,12,82,82,82,62,127,8,4,4,120,0,68,125,64,0,32,64,68,61,0,127,16,40,68,0,0
465
db 65,127,64,0,124,4,24,4,120,124,8,4,4,120,56,68,68,68,56,124,20,20,20,8,8,20,20,24
466
db 124,124,8,4,4,8,72,84,84,84,32,4,63,68,64,32,60,64,64,32,124,28,32,64,32,28,60,64
467
db 48,64,60,68,40,16,40,68,12,80,80,80,60,68,100,84,76,68,0,8,54,65,0,0,0,127,0,0
468
db 0,65,54,8,0,16,8,8,16,8,0,6,9,9,6
470
;********************************************************************************
474
cpfslt SysStringA,ACCESS
476
movf SysStringA, W,ACCESS
477
addlw low TableASCII_TABLE_L
479
movlw high TableASCII_TABLE_L
480
btfsc STATUS, C,ACCESS
484
movf TABLAT, W,ACCESS
487
db 240,0,0,0,0,0,0,0,95,0,0,0,7,0,7,0,20,127,20,127,20,36,42,127,42,18,35,19,8,100
488
db 98,54,73,85,34,80,0,5,3,0,0,0,28,34,65,0,0,65,34,28,0,20,8,62,8,20,8,8,62,8,8,0
489
db 80,48,0,0,8,8,8,8,8,0,96,96,0,0,32,16,8,4,2,62,81,73,69,62,0,66,127,64,0,66,97,81
490
db 73,70,33,65,69,75,49,24,20,18,127,16,39,69,69,69,57,60,74,73,73,48,1,113,9,5,3,54
491
db 73,73,73,54,6,73,73,41,30,0,54,54,0,0,0,86,54,0,0,8,20,34,65,0,20,20,20,20,20,0
492
db 65,34,20,8,2,1,81,9,6,50,73,121,65,62,126,17,17,17,126,127,73,73,73,54,62,65,65,65
493
db 34,127,65,65,34,28,127,73,73,73,65,127,9,9,9,1,62,65,73,73,122,127,8,8,8,127,0,65
494
db 127,65,0,32,64,65,63,1,127,8,20,34,65,127,64,64,64,64,127,2,12,2,127,127,4,8,16,127
497
;********************************************************************************
500
incf SysWaitTempMS_H, F,ACCESS
503
movwf DELAYTEMP2,ACCESS
506
movwf DELAYTEMP,ACCESS
508
decfsz DELAYTEMP, F,ACCESS
510
decfsz DELAYTEMP2, F,ACCESS
512
decfsz SysWaitTempMS, F,ACCESS
514
decfsz SysWaitTempMS_H, F,ACCESS
518
;********************************************************************************
523
movwf SysWaitTempMS,ACCESS
525
movwf SysWaitTempMS_H,ACCESS
527
decfsz SysWaitTempS, F,ACCESS
531
;********************************************************************************
535
subwf GLCDCHAR,W,BANKED
536
btfsc STATUS, C,ACCESS
539
subwf GLCDCHAR,W,BANKED
540
movwf SysTemp1,BANKED
544
movwf SysRepeatTemp4,BANKED
546
incf GLCDCHAR,F,BANKED
547
movff GLCDCHAR,SysStringA
549
movwf CHARLINE,BANKED
551
movwf GLCDCOMDAT,BANKED
552
movff CHARLINE,GLCDDAT
554
movff GLCDDAT,CHARLINE
555
decfsz SysRepeatTemp4,F,BANKED
561
subwf GLCDCHAR,W,BANKED
562
movwf SysTemp1,BANKED
566
movwf SysRepeatTemp4,BANKED
568
incf GLCDCHAR,F,BANKED
569
movff GLCDCHAR,SysStringA
571
movwf CHARLINE,BANKED
573
movwf GLCDCOMDAT,BANKED
574
movff CHARLINE,GLCDDAT
576
movff GLCDDAT,CHARLINE
577
decfsz SysRepeatTemp4,F,BANKED
582
movwf GLCDCOMDAT,BANKED
586
;********************************************************************************
590
movwf SysRepeatTemp3,BANKED
592
movwf SysRepeatTemp3_H,BANKED
595
movwf GLCDCOMDAT,BANKED
598
decfsz SysRepeatTemp3,F,BANKED
600
decfsz SysRepeatTemp3_H,F,BANKED
605
;********************************************************************************
608
setf GLCDINDEX,BANKED
610
incf GLCDINDEX,F,BANKED
611
movff GLCDINDEX,GLCDP_X
615
movwf GLCDCOMDAT,BANKED
620
subwf GLCDINDEX,W,BANKED
621
btfss STATUS, C,ACCESS
624
setf GLCDINDEX,BANKED
626
incf GLCDINDEX,F,BANKED
627
movff GLCDINDEX,GLCDP_X
632
movwf GLCDCOMDAT,BANKED
637
subwf GLCDINDEX,W,BANKED
638
btfss STATUS, C,ACCESS
641
setf GLCDINDEX,BANKED
643
incf GLCDINDEX,F,BANKED
646
movff GLCDINDEX,GLCDP_Y
649
movwf GLCDCOMDAT,BANKED
653
subwf GLCDINDEX,W,BANKED
654
btfss STATUS, C,ACCESS
657
setf GLCDINDEX,BANKED
659
incf GLCDINDEX,F,BANKED
661
movff GLCDINDEX,GLCDP_Y
664
movwf GLCDCOMDAT,BANKED
668
subwf GLCDINDEX,W,BANKED
669
btfss STATUS, C,ACCESS
674
;********************************************************************************
677
clrf GLCDCOMDAT,BANKED
679
iorwf GLCDP_X,W,BANKED
682
clrf GLCDCOMDAT,BANKED
684
iorwf GLCDP_Y,W,BANKED
688
;********************************************************************************
690
;Overloaded signature: STRING:
692
clrf GLCDINDEX,BANKED
693
movff SysGLCDSTRDATHandler,AFSR0
694
movff SysGLCDSTRDATHandler_H,AFSR0_H
697
btfss STATUS, C,ACCESS
700
incf GLCDINDEX,F,BANKED
701
movf GLCDINDEX,W,BANKED
702
addwf SysGLCDSTRDATHandler,W,BANKED
705
addwfc SysGLCDSTRDATHandler_H,W,BANKED
709
movf GLCDINDEX,W,BANKED
710
addwf SysGLCDSTRDATHandler,W,BANKED
713
addwfc SysGLCDSTRDATHandler_H,W,BANKED
716
movff SysGLCDSTRDATHandler,AFSR0
717
movff SysGLCDSTRDATHandler_H,AFSR0_H
719
subwf GLCDINDEX,W,BANKED
720
btfss STATUS, C,ACCESS
725
;********************************************************************************
728
decf GLCDCOMDAT,W,BANKED
729
btfss STATUS, Z,ACCESS
737
movwf SysRepeatTemp2,BANKED
740
btfss GLCDDAT,7,BANKED
747
rlcf GLCDDAT,F,BANKED
753
decfsz SysRepeatTemp2,F,BANKED
758
;********************************************************************************
760
;Overloaded signature: STRING:
762
movff SysPRINTDATAHandler,AFSR0
763
movff SysPRINTDATAHandler_H,AFSR0_H
765
movf PRINTLEN,F,BANKED
766
btfsc STATUS, Z,ACCESS
768
clrf SYSPRINTTEMP,BANKED
770
subwf PRINTLEN,W,BANKED
771
btfss STATUS, C,ACCESS
774
incf SYSPRINTTEMP,F,BANKED
775
movf SYSPRINTTEMP,W,BANKED
776
addwf SysPRINTDATAHandler,W,BANKED
779
addwfc SysPRINTDATAHandler_H,W,BANKED
784
movwf SysWaitTempMS,ACCESS
785
clrf SysWaitTempMS_H,ACCESS
787
movf PRINTLEN,W,BANKED
788
subwf SYSPRINTTEMP,W,BANKED
789
btfss STATUS, C,ACCESS
795
;********************************************************************************
799
btfss PIR1,TXIF,ACCESS
804
;********************************************************************************
809
movwf SysWaitTempMS,ACCESS
810
clrf SysWaitTempMS_H,ACCESS
813
clrf GLCDCOMDAT,BANKED
817
clrf GLCDCOMDAT,BANKED
821
clrf GLCDCOMDAT,BANKED
825
clrf GLCDCOMDAT,BANKED
829
clrf GLCDCOMDAT,BANKED
833
clrf GLCDCOMDAT,BANKED
837
clrf GLCDCOMDAT,BANKED
842
;********************************************************************************
847
bcf ADCON2,ADFM,ACCESS
848
bcf ADCON0,ADON,ACCESS
849
bsf ADCON1,PCFG3,ACCESS
850
bsf ADCON1,PCFG2,ACCESS
851
bsf ADCON1,PCFG1,ACCESS
852
bsf ADCON1,PCFG0,ACCESS
861
;********************************************************************************
867
bsf BAUDCON,BRG16,ACCESS
868
bsf TXSTA,BRGH,ACCESS
869
bcf TXSTA,SYNC,ACCESS
870
bsf RCSTA,SPEN,ACCESS
871
bsf RCSTA,CREN,ACCESS
872
bsf TXSTA,TXEN,ACCESS
875
;********************************************************************************
879
movff TABLAT,SYSCALCTEMPA
882
bra SYSSTRINGREADCHECK
885
movf TABLAT, W,ACCESS
886
movwf SYSCALCTEMPA,ACCESS
887
addwf SYSSTRINGLENGTH,F,ACCESS
890
movf SYSCALCTEMPA,F,ACCESS
891
btfsc STATUS,Z,ACCESS
896
decfsz SYSCALCTEMPA, F,ACCESS
900
;********************************************************************************
921
dw 4883,"Printing Display: 1"
925
dw 4883,"Printing Display: 2"
928
;********************************************************************************