8-Bit Software Online Conversion
:2.$.Teled7 - Listing
10MODE7
20DIM code% 200
30buffer%=&6400
40HIMEM=buffer%
50PROCinit
60PROCassemble:CALLZ%
70:
80VDU23;10,&60;0;0;0
90VDU23,1,0;0;0;0;
100D%=0:E%=1:REM Datac Epson
110CLS
120PRINT'
130PRINTTAB(4)CHR$130CHR$141"80 Column
Teletext Editor"
140PRINTTAB(4)CHR$131CHR$141"80 Column
Teletext Editor"
150PRINTTAB(5)CHR$146"££££££££££££££££
£££££££££"
160PRINT
170PRINTTAB(4)CHR$130CHR$141"H to load
help screen"
180PRINTTAB(4)CHR$131CHR$141"H to load
help screen"
190PRINT
200PRINTTAB(4)CHR$130CHR$141"Any other
key for a new page"
210PRINTTAB(4)CHR$131CHR$141"Any other
key for a new page"
220Q%=GET
230IFQ%=27:PROCexit:CHAIN"TelMenu"
240VDU23,1,1;0;0;0;
250IFQ%=ASC"D"ORQ%=ASC"d":D%=1:E%=0:RE
M Datac Epson
260IFQ%=ASC"H"ORQ%=ASC"h":OSCLI("LOAD
Help72 "+STR$÷(buffer%)):PROCinit
270:
280REM maxline%=60 for Datac 72 for Ep
son
290IFE%:maxline%=72 ELSE maxline%=60
300ONERROR:*FX229,1
310REPEAT
320PRINTTAB(pos%,vpos%);
330!start%=buffer%+(stlinpnt%*80)+stco
lpnt%
340CALLT%
350a%=GET:A%=a%
360IFA%<>27:PROCkeys
370UNTILA%=27
380PROCsave
390PROCexit:CHAIN"TelMenu"
400:
410DEFPROCkeys
420IFA%=1:PROCscrleft:ENDPROC
430IFA%=3:PROCzap:ENDPROC
440IFA%=4:PROCscrright:ENDPROC
450IFA%=12:PROCload:ENDPROC
460IFA%=13:PROCnewline:ENDPROC
470IFA%=16:PROCprint:ENDPROC
480IFA%=19:PROCsave:ENDPROC
490IFA%=23:PROCscrup:ENDPROC
500IFA%=24:PROCscrdown:ENDPROC
510IFINSTR("QWASZXqwaszx",CHR$(a%))<>0
ANDt%:PROCpixel:ENDPROC
520IFA%=135ORA%=127:PROCdelete:ENDPROC
530IFA%=136:PROCleft:ENDPROC
540IFA%=137:PROCright:ENDPROC
550IFA%=138:PROCdown:ENDPROC
560IFA%=139:PROCup:ENDPROC
570IFa%>=200ANDa%<=229:PROCfkeys
580IFA%=226:PROCinspc:ENDPROC
590IFA%=227:PROCinsline:ENDPROC
600IFA%=228:PROCdelline:ENDPROC
610IFA%=209ORA%=219ORA%=229:PROCptog:E
NDPROC
620IFt%=0ANDA%>31:?(buffer%+line%*80+c
ol%)=A%:PROCright
630ENDPROC
640:
650DEFPROCfkeys
660IFa%>=200ANDa%<=208:A%=a%-71
670IFa%>=210ANDa%<=216:A%=a%-65
680IFa%>=217ANDa%<=218:A%=a%-61
690IFa%>=220ANDa%<=221:A%=a%-67
700IFa%>=222ANDa%<=223:A%=a%-64
710IFa%>=224ANDa%<=225:A%=365-a%
720ENDPROC
730:
740DEFPROCexit
750*FX4,0
760*FX229,0
770VDU23;10,&70;0;0;0
780ENDPROC
790:
800DEFPROCzap
810PROCask("Clear text")
820IFINSTR("Yy",CHR$(Q%))=0:ENDPROC
830CALLZ%
840ENDPROC
850:
860DEFPROCnewline
870IFline%=maxline%:VDU7:ENDPROC
880PROCdown
890IFcol%<>0:REPEAT:PROCleft:UNTILcol%
=0
900ENDPROC
910:
920DEFPROCpixel
930LOCALW%
940W%=2^((INSTR("QWASZ X",CHR$(a%AND22
3)))-1)
950K%=buffer%+line%*80+col%
960IF(?K%AND160)<>160:?K%=?K%OR160
970IF?(K%ANDW%)=W%:?K%=?K%AND(255-W%)E
LSE?K%=?K%EORW%
980ENDPROC
990:
1000DEFPROCptog
1010t%=t%EOR1
1020IFt%:VDU23;10,&70;0;0;0 ELSE VDU23;
10,&60;0;0;0
1030ENDPROC
1040:
1050DEFPROCleft
1060IFpos%>0:pos%=pos%-1:col%=col%-1:EN
DPROC
1070IFcol%>0:col%=col%-1:stcolpnt%=stco
lpnt%-1:ENDPROC
1080IFline%=0:VDU7:ENDPROC
1090line%=line%-1:pos%=39:col%=79:stcol
pnt%=40
1100IFvpos%>0:vpos%=vpos%-1:ENDPROC
1110stlinpnt%=stlinpnt%-1
1120ENDPROC
1130:
1140DEFPROCscrleft
1150IFstcolpnt%=0:VDU7:ENDPROC
1160stcolpnt%=stcolpnt%-1:col%=col%-1
1170ENDPROC
1180:
1190DEFPROCright
1200IFpos%<39:pos%=pos%+1:col%=col%+1:E
NDPROC
1210IFcol%<79:col%=col%+1:stcolpnt%=stc
olpnt%+1:ENDPROC
1220IFline%=maxline%:VDU7:ENDPROC
1230line%=line%+1:pos%=0:col%=0:stcolpn
t%=0
1240IFvpos%<24:vpos%=vpos%+1:ENDPROC
1250stlinpnt%=stlinpnt%+1
1260ENDPROC
1270:
1280DEFPROCscrright
1290IFstcolpnt%=40:VDU7:ENDPROC
1300stcolpnt%=stcolpnt%+1:col%=col%+1
1310ENDPROC
1320:
1330DEFPROCdown
1340IFline%=maxline%:VDU7:ENDPROC
1350line%=line%+1
1360IFvpos%<24:vpos%=vpos%+1:ENDPROC
1370stlinpnt%=stlinpnt%+1
1380ENDPROC
1390:
1400DEFPROCscrdown
1410IFstlinpnt%>=maxline%-24:VDU7:ENDPR
OC
1420stlinpnt%=stlinpnt%+1:line%=line%+1
1430ENDPROC
1440:
1450DEFPROCup
1460IFline%=0:VDU7:ENDPROC
1470line%=line%-1
1480IFvpos%>0:vpos%=vpos%-1:ENDPROC
1490stlinpnt%=stlinpnt%-1
1500ENDPROC
1510:
1520DEFPROCscrup
1530IFstlinpnt%=0:VDU7:ENDPROC
1540stlinpnt%=stlinpnt%-1:line%=line%-1
1550ENDPROC
1560:
1570DEFPROCdelete
1580IFA%=127:IFcol%=0:VDU7:ENDPROC
1590IFA%=127:PROCleft
1600org%=buffer%+line%*80
1610FORI%=col% TO 79:?(org%+I%)=?(org%+
I%+1):NEXT
1620org%?79=32
1630ENDPROC
1640:
1650DEFPROCinspc
1660org%=buffer%+line%*80+col%
1670dest%=buffer%+line%*80+79
1680diff%=dest%-org%
1690FORI%=0TOdiff%
1700?(dest%-I%)=?(dest%-I%-1)
1710NEXT
1720?org%=32
1730ENDPROC
1740:
1750DEFPROCinsline
1760LOCALP%
1770org%=&70:dest%=&74:end%=&78:stop%=&
7C
1780!org%=buffer%+(maxline%-1)*80+79
1790!dest%=buffer%+maxline%*80+79
1800!end%=buffer%+line%*80
1810!stop%=buffer%+line%*80+79
1820FORI%=0TO2STEP2
1830P%=&980
1840[OPTI%
1850LDY#0
1860.loop
1870LDA(org%),Y:STA(dest%),Y
1880LDAorg%::BNEd1
1890DECorg%+1
1900.d1
1910DECorg%
1920LDAdest%:BNEd2
1930DECdest%+1
1940.d2
1950DECdest%
1960LDAorg%+1:CMPend%+1:BNEloop
1970LDAorg%:CMPend%:BCSloop
1980RTS
1990]NEXT
2000CALL&980
2010REPEAT
2020?!end%=32
2030!end%=!end%+1
2040UNTIL!end%=!stop%+1
2050ENDPROC
2060:
2070DEFPROCdelline
2080LOCALP%
2090org%=&70:dest%=&74:end%=&78:stop%=&
7C
2100!org%=buffer%+(line%+1)*80
2110!dest%=buffer%+line%*80
2120!end%=buffer%+maxline%*80+79
2130!stop%=buffer%+maxline%*80
2140FORI%=0TO2STEP2
2150P%=&980
2160[OPTI%
2170LDY#0
2180.loop
2190LDA(org%),Y:STA(dest%),Y
2200INCorg%::BNEd1:INCorg%+1
2210.d1
2220INCdest%:BNEd2:INCdest%+1
2230.d2
2240LDAend%+1:CMPorg%+1:BNEloop
2250LDAend%:CMPorg%:BCSloop
2260RTS
2270]NEXT
2280CALL&980
2290REPEAT
2300?!end%=32
2310!end%=!end%-1
2320UNTIL!end%=!stop%-1
2330ENDPROC
2340:
2350DEFPROCprint
2360PROCask("Print text")
2370IFINSTR("Yy",CHR$(Q%))=0:ENDPROC
2380PRINT'TAB(4)CHR$130CHR$141"Printing
text please wait"
2390PRINTTAB(4)CHR$131CHR$141"Printing
text please wait"
2400O%=buffer%:o%=0:graphic%=0:sep%=0
2410datac%=D%:epson%=E%
2420VDU2
2430IFepson%:VDU1,27,1,48
2440IFdatac%:VDU1,27,1,65,1,11
2450FORl%=0TOmaxline%
2460FORc%=1TO80
2470d%=?(O%+o%)
2480IFd%<32:d%=32
2490IF(epson%+datac%)=0 AND (d%<32ORd%>
126):d%=32
2500IFd%>127AND(epson%+datac%):PROCepri
nt
2510VDU1,d%
2520o%=o%+1
2530NEXT
2540IFepson%:VDU1,10
2550VDU1,13:graphic%=0:sep%=0
2560NEXT
2570VDU1,27,1,50
2580VDU1,13,1,12,3
2590ENDPROC
2600:
2610DEFPROCeprint
2620IFd%=&80:d%=32:ENDPROC
2630IFd%>&80 AND d%<&88:graphic%=0:d%=3
2:ENDPROC
2640IFd%>&87 AND d%<&91:d%=32:ENDPROC
2650IFd%>&90 AND d%<&98:graphic%=1:d%=3
2:ENDPROC
2660IFd%=&99:sep%=0
2670IFd%=&9A:sep%=1
2680IFd%>&97 AND d%<&A0:d%=32:ENDPROC
2690IFd%>&BF AND d%<&E0:d%=32:ENDPROC
2700IFgraphic%=0:d%=32:ENDPROC
2710IFepson%:PROCepson
2720IFdatac%:PROCdatac
2730d%=0
2740ENDPROC
2750:
2760DEFPROCdatac
2770VDU1,27,1,54
2780VDU1,d%
2790VDU1,27,1,55
2800ENDPROC
2810:
2820DEFPROCepson
2830flag%=0
2840FORn%=0TO6
2850flag%=flag%+(d%AND2^n%)
2860NEXT
2870:
2880VDU1,27,1,ASC"^",1,0,1,6,1,0
2890pr%=0
2900IFflag%AND1:pr%=pr%+&E0-(sep%*&20)
2910IFflag%AND4:pr%=pr%+&1C-(sep%*&04)
2920IFflag%AND16:pr%=pr%+&8003-(sep%*&8
000)
2930IFsep%:VDU1,0,1,0
2940FORn%=sep%TO2
2950VDU1,pr%AND&FF
2960VDU1,(pr%AND&FF00)DIV&100
2970NEXT
2980pr%=0
2990IFflag%AND2:pr%=pr%+&E0-(sep%*&20)
3000IFflag%AND8:pr%=pr%+&1C-(sep%*&04)
3010IFflag%AND64:pr%=pr%+&8003-(sep%*&8
000)
3020IFsep%:VDU1,0,1,0
3030FORn%=sep%TO2
3040VDU1,pr%AND&FF
3050VDU1,(pr%AND&FF00)DIV&100
3060NEXT
3070ENDPROC
3080:
3090DEFPROCask(message$)
3100REPEAT
3110CLS
3120PRINT'TAB(8)CHR$130CHR$141message$"
y/n ? "
3130PRINTTAB(8)CHR$131CHR$141message$"
y/n ? "
3140Q%=GET
3150UNTILINSTR("YyNn ",CHR$(Q%))<>0ORQ%
=13ORQ%=27
3160ENDPROC
3170:
3180DEFPROCload
3190PROCask("Load file")
3200IFINSTR("Yy",CHR$(Q%))=0:ENDPROC
3210PROCfile("Load file")
3220OSCLI("LOAD "+f$+" "+STR$÷(buffer%)
)
3230PROCinit
3240ENDPROC
3250:
3260DEFPROCsave
3270PROCask("Save file")
3280IFINSTR("Yy",CHR$(Q%))=0:ENDPROC
3290PROCfile("Save file")
3300OSCLI("SAVE "+f$+" "+STR$÷(buffer%)
+"+"+STR$÷((maxline%+1)*80))
3310ENDPROC
3320:
3330DEFPROCfile(message$)
3340*FX229,0
3350REPEAT
3360CLS
3370PRINTTAB(10)CHR$130CHR$141message$
3380PRINTTAB(10)CHR$131CHR$141message$
3390PRINTTAB(11)CHR$146"£££££££££"
3400PRINT
3410OSCLI(".")
3420REM PRINT'" OS command or"
3430REPEAT
3440INPUTLINE'" *command or Filename ?
"f$
3450UNTILf$<>""
3460IFINSTR(f$,"*"):OSCLIf$
3470UNTILINSTR(f$,"*")=0
3480*FX229,1
3490ENDPROC
3500:
3510DEFPROCinit
3520*FX18
3530*FX21
3540*FX4,1
3550*FX229,1
3560*FX225,200
3570*FX226,210
3580*FX227,220
3590stcolpnt%=0:stlinpnt%=0
3600pos%=0:vpos%=0:line%=0:col%=0
3610start%=&70
3620t%=0
3622*KEY10"*EXEC !BOOT|M"
3630ENDPROC
3640:
3650PROCexit
3660*FX229,0
3670*FX4,0
3680ENDPROC
3690:
3700DEFPROCassemble
3710begin=&80
3720source=&82
3730dest=&84
3740FORI%=0TO2STEP2
3750P%=code%
3760[OPTI%
3770.T%
3780LDX#0:STXcounter:STXcounter+1
3790LDAstart%:STAbegin
3800LDAstart%+1:STAbegin+1
3810.loop1
3820LDAbegin:STAsource
3830LDAbegin+1:STAsource+1
3840LDA#0:STAdest
3850LDA#&7C:STAdest+1
3860CLC:LDAsource:ADCcounter:STAsource
3870BCCnc1:INCsource+1
3880.nc1
3890CLC:LDAsource+1:ADCcounter+1:STAsou
rce+1
3900CLC:LDAdest:ADCcounter:STAdest
3910BCCnc2:INCdest+1
3920.nc2
3930CLC:LDAdest+1:ADCcounter+1:STAdest+
1
3940LDY#0:LDA(source),Y:STA(dest),Y
3950INX:CPX#40:BNEnotx
3960.addloop
3970INCbegin:BNEnc4:INCbegin+1
3980.nc4
3990DEX:BNEaddloop
4000.notx
4010INCcounter
4020BNEnc3:INCcounter+1
4030.nc3
4040LDAcounter+1:CMP#4:BNEloop1
4050RTS
4060.Z%
4070LDA#buffer%MOD256:STAdest
4080LDA#buffer%DIV256:STAdest+1
4090LDA#32:LDY#0
4100.zaploop
4110STA(dest),Y
4120INCdest:BNEnc5:INCdest+1
4130.nc5
4140LDXdest+1:CPX#&7C:BNEzaploop
4150RTS
4160.counter
4170EQUW0
4180]NEXT
4190ENDPROC