8-Bit Software Online Conversion
Data Transfer - Listing
10 ONERROR
20 ?&72=0
30 MODE3
40 VDU22,7
50 VDU23,1,0;0;0;0;
60 *FX21,0
70 *FX225,129
80 *KEY10"*DIR$|M*EX.!BOOT|M"
90 CLS
100 ack%=129:busy%=129:strobe%=129
110 pnt=0:title$=CHR$(255):PROCdata
120 pnt=0
130 title$="Parallel Data Transfer"
140 k$=CHR$(132)+CHR$(157)+CHR$(130)
150 t$=CHR$(132)+CHR$(157)+CHR$(131)
160 g$=CHR$(132)+CHR$(157)+CHR$(151)
170 cable$="]]]]]] "+CHR$(156)
180 REPEAT
190 FOR pass=1 TO 4
200 IFpass=3:PROCdata
210 IFpass=1:ack%=129ELSEack%=128
220 IFpass=1:busy%=129ELSEbusy%=128
230 IFpass=4:strobe%=128ELSEstrobe%=12
9
240 VDU30
250 PRINTt$" ";
260 FOR A=1 TO pnt:VDU32:NEXT:VDU42
270 FOR A=pnt TO 28:VDU32:NEXT:PRINT
280PRINTt$CHR$(129)CHR$(141)" "titl
e$
290PRINTt$CHR$(129)CHR$(141)" "titl
e$
300PRINTt$CHR$(154)CHR$(145)" £££££
£££££££££££££££££"
310PRINTt$"printer
user"
320PRINTt$"port
port"
330PRINTt$
340PRINTCHR$(130)CHR$(busy%)" BUSY"k$
CHR$(busy%)"[[[[[[ "CHR$(156)" "k$"
"CHR$(156)
350PRINTCHR$(130)CHR$(ack%)" ACK"k$C
HR$(ack%)"[[[[[[ "CHR$(156)" "k$"
"CHR$(156)
360PRINTCHR$(130)CHR$(d7)" bit7"k$CHR
$(d7)cable$CHR$(135)"A "k$CHR$(d7)cable$
"bit7"
370PRINTCHR$(130)CHR$(d6)" bit6"k$CHR
$(d6)cable$CHR$(135)"D "k$CHR$(d6)cable$
"bit6"
380PRINTCHR$(130)CHR$(d5)" bit5"k$CHR
$(d5)cable$CHR$(135)"A "k$CHR$(d5)cable$
"bit5"
390PRINTCHR$(130)CHR$(d4)" bit4"k$CHR
$(d4)cable$CHR$(135)"A "k$CHR$(d4)cable$
"bit4"
400PRINTCHR$(130)CHR$(d3)" bit3"k$CHR
$(d3)cable$CHR$(135)"P "k$CHR$(d3)cable$
"bit3"
410PRINTCHR$(130)CHR$(d2)" bit2"k$CHR
$(d2)cable$CHR$(135)"T "k$CHR$(d2)cable$
"bit2"
420PRINTCHR$(130)CHR$(d1)" bit1"k$CHR
$(d1)cable$CHR$(135)"O "k$CHR$(d1)cable$
"bit1"
430PRINTCHR$(130)CHR$(d0)" bit0"k$CHR
$(d0)cable$CHR$(135)"R "k$CHR$(d0)cable$
"bit0"
440PRINTCHR$(130)CHR$(strobe%)"STROBE"
k$CHR$(strobe%)cable$" "k$CHR$(ack%)"[
[[[[[ "CHR$(156)"CB2"
450PRINT" "k$" "CHR$(156
)" "k$CHR$(strobe%)cable$"CB1"
460PRINTt$
470PRINTt$"Press:-"
480PRINTt$"The space bar to pause the
screen."
490PRINTt$
500PRINTt$"Any other key for the main
program."
510PRINTt$;
520 A%=INKEY(100):IFA%=32:A%=GET
530 IFA%>32ORA%=13:PROCpdt
540 NEXT
550 UNTIL FALSE
560:
570 DEFPROCdata
580 pnt=pnt+1:IFpnt>LEN(title$):pnt=1
590 c$=MID$(title$,pnt,1)
600 d0=SGN(ASC(c$)AND1)+128
610 d1=SGN(ASC(c$)AND2)+128
620 d2=SGN(ASC(c$)AND4)+128
630 d3=SGN(ASC(c$)AND8)+128
640 d4=SGN(ASC(c$)AND16)+128
650 d5=SGN(ASC(c$)AND32)+128
660 d6=SGN(ASC(c$)AND64)+128
670 d7=SGN(ASC(c$)AND128)+128
680 ENDPROC
690:
700 DEFPROCpdt
710:
720 REM Setup initial ignore codes
722 FORT=0TO30:?(&980+T)=0:NEXT
730 READN:?&980=N
740 FORT=1TON
750 READcode:READcode$
760 ?(&980+T)=code
770 NEXT
780:
790 S$="":CLS:REPEAT:VDU30
800PRINTt$
810PRINTt$CHR$(129)CHR$(141)" "titl
e$
820PRINTt$CHR$(129)CHR$(141)" "titl
e$
830PRINTt$CHR$(154)CHR$(145)" £££££
£££££££££££££££££"
840PRINTt$
850PRINTt$
860PRINTg$" ¶¶¶¶¶¶¶t "CHR$(15
0)" x¶¶¶¶¶¶¶"
870PRINTg$" ¶¶¶¶¶¶¶¶¾ "CHR$(15
0)" ÷¶¶¶¶¶¶¶¶"
880PRINTg$" ¶¶¶¶¶¶¶¶¶ "CHR$(15
0)" ¶¶¶¶¶¶¶¶¶"
890PRINTg$" ¶¶¶¶¶¶¶¶¶ "CHR$(15
0)" ¶¶¶¶¶¶¶¶¶"
900PRINTg$" ¶¶¶¶¶¶¶¶¶ "CHR$(15
0)" o¶¶¶¶¶¶¶¶"
910PRINTg$" ¶¶¶¶¶¶¶¶' "CHR$(15
0)" +¶¶¶¶¶¶¶"
920PRINTg$" *?////?! "CHR$(15
0)" ppp||¶||p"
930PRINTg$" p|"CHR$(156)"|||||||"g$CH
R$(150)" ¶¶¶¶¶¶¶¶¶ p"
940PRINTg$"|¶¶¶"CHR$(156)"¶¶¶¶¶¶¶"CHR$
(132)CHR$(157)CHR$(128)"[[[[["CHR$(150)"
¶¶¶¶¶¶¶¶¶ ¶¶|p"
950PRINTt$
960PRINTt$"Space bar toggles binary/as
cii data"
970PRINTt$
980 IF ?&72=1:A$="RECEIVE ASCII DATA
" ELSE A$="RECEIVE BINARY DATA ]"+CHR$
(129)
990PRINTt$CHR$(141)A$
1000PRINTt$CHR$(141)A$
1010PRINTt$
1020PRINTt$CHR$(141)"FILENAME ?"CHR$(12
9)
1030PRINTt$CHR$(141)"FILENAME ?"CHR$(12
9)
1040PRINTt$
1050PRINTt$;
1060
1070 PRINTTAB(15,22)S$" ";
1080 PRINTTAB(15,21)S$" ";
1090 A%=INKEY(10)
1100 IFA%=32:?&72=?&72 EOR 1
1110 IFA%=127:S$=MID$(S$,1,LEN(S$)-1)
1120 IFA%>32 AND A%<127:S$=S$+CHR$(A%)
1130 IFA%>127:PROCaltercodes
1140 UNTIL A%=13
1150
1160 IF ?&72:VDU22,3 ELSE VDU31,26,18
1170 F%=OPENOUT S$
1180
1190 old%=!&204 AND &FFFF
1200
1210 FOR I%=0 TO 2 STEP 2
1220 P%=&600
1230 [OPTI%
1240 LDA &FC:PHA
1250 TXA:PHA
1260 TYA:PHA
1270 ½ check if is CB1 interupt
1280 LDA &FE6D:AND #&90:CMP #&90:BNE en
d
1290 ½ Service routine
1300 LDA #&EE:STA &FE6C:½ Pull up cb2
1310 LDA #&FF:STA &70 ½ Set recieve fla
g
1320 LDA &FE60:STA &80:½ Clear CB1 inte
rupt
1330 .end
1340 PLA:TAY
1350 PLA:TAX
1360 PLA:STA &FC
1370 JMP old% ½ Return via normal rou
tine
1380 ]NEXT
1390
1400 !&204=!&204 AND &FFFF0000 OR &600
1410 ON ERROR PROCerror
1420
1430 miss%=0:check%=0
1440 ?&80=?&FE60:PROCget
1450
1460 REM Enable CB1 interupts
1470 ?&FE6E=&90
1480
1490 REPEAT
1500
1510 *FX151,108,206
1520 REPEAT:UNTIL?&70=&FF
1530 PROCget
1540
1550 UNTIL FALSE
1560
1570 ENDPROC
1580
1590 DEFPROCget
1600 IF ?&72 THEN PROCgetascii ELSE PRO
Cgetbinery
1610 ENDPROC
1620
1630 DEFPROCgetascii
1640 ?&70=0:REM Clear recieve flag
1650 C%=?&80
1660 IF check%:PROCcodes
1670 IF C%=27:miss%=1:check%=1
1680 IF miss%=0 AND C%<>10:VDUC%
1690 IF C%=13:VDU10
1700 IF C%=10:miss%=1
1710 IF miss%=0:BPUT#F%,C%
1720 IF miss%:miss%=miss%-1
1730 ENDPROC
1740
1750 DEFPROCgetbinery
1760 ?&7E41=?&7E41 EOR 1
1770 ?&70=0:REM Clear recieve flag
1780 C%=?&80
1790 IF C%>31 AND C%<127:VDUC%,8,10,C%,
8,11
1800 ?&7E41=?&7E41 EOR 1
1810 BPUT#F%,C%
1820 ENDPROC
1830
1840 DEFPROCcodes
1850 REM Preweight longer codes
1860 FORT=1TO?&980
1870 IFC%=?(&980+T):miss%=1
1880 NEXT
1890 REM This caters for all single con
trol codes
1900 miss%=miss%+1
1910 check%=0
1920 ENDPROC
1930
1940 DEFPROCaltercodes
1950 CLS
1952 REPEAT:VDU30
1956 PRINT"All single codes are ignored
i.e ESC,69"
1957 PRINT"This is a list of double cod
es that"
1958 PRINT"need special attention i.e.
ESC,83,48"
1959 PRINT'
1960 FORT=1 TO 30 STEP 3
1971 PRINTCHR$(131);:IFT<10:PRINT" ";
1972 PRINTSTR$(T);" ="CHR$(134);STR$(?(
&980+T));
1973 PRINTTAB(15)CHR$(131);:IFT<10PRINT
" ";
1974 PRINTCHR$(131)STR$(T+1);" =";CHR$(
134);STR$(?(&980+T+1));
1975 PRINTTAB(28)CHR$(131);:IFT<10PRINT
" ";
1976 PRINTCHR$(131)STR$(T+2);" =";CHR$(
134);STR$(?(&980+T+2))
1980 NEXT
1990 PRINT'
1992 PRINT" + TO ADD DATA"
1993 PRINT" - TO REMOVE DATA"
2000 PRINT" S TO SAVE DATA"
2010 PRINT" L TO LOAD DATA"
2012 PRINT" X TO EXIT"
2014 PRINT
2020 do$=GET$
2024 IF do$="+":INPUT"value",n$:IF VAL(
n$):?(&981+?&980)=VAL(n$):?&980=?&980+1
2025 IF do$="-":INPUT"Number ",N%:IF N%
:FORT=N%TO?&980:?(&980+T)=?(&980+T+1):NE
XT:?(&980)=?&980-1
2026 IF do$="S"ORdo$="s":INPUT"Filename
",f$:OSCLI("SAVE "+f$+" 980 "+STR$÷((&98
1+?&980)))
2028 IF do$="L"ORdo$="l":FORT=0TO30:?(&
980+T)=0:NEXT:INPUT"Filename",f$:OSCLI("
LOAD "+f$)
2029 CLS
2030 UNTILdo$="x" OR do$="X"
2038 ENDPROC
2040
2050 DEFPROCerror
2060 *FX151,108,238
2070 REM Disable CB1 interupts
2080 ?&FE6E=&10
2090 !&204=!&204 AND &FFFF0000 OR old%
2100 CLOSE#F%
2110 RUN
2120
2130REM Initial Settings
2140DATA16:REM Number of data
2150DATA45,"Underline"
2160DATA51,"Linefeed pitch"
2170DATA53,"CR command"
2180DATA65,"Linefeed pitch"
2190DATA67,"Page Length"
2200DATA74,"+ve feed after printing"
2210DATA78,"Bottom line skip"
2220DATA81,"Rignt Margin"
2230DATA83,"Superscript"
2240DATA85,"Uni/bi directional"
2250DATA87,"Double Width"
2260DATA105,"Immediate printing"
2270DATA106,"-ve feed after printing"
2280DATA108,"Left Margin"
2290DATA112,"Proportional"
2300DATA120,"NLQ"