8-Bit Software Online Conversion
:2.$.Editor - Listing
10REM maxline%=60 for Datac 72 for Ep
son
20IFE%:maxline%=72 ELSE maxline%=60
30PROCinit
32*KEY10"*EXEC !BOOT|M"
40ONERROR:CALLS%:*FX229,1
50:
60REPEAT
70!start%=buffer%+stlinpnt%*80
80IFdisplay%:VDU23,1,0;0;0;0;:CALLC%:
PRINT" ";STRING$(78,"-");:VDU23,1,1;0;0;
0;:display%=0
90PRINTTAB(pos%,vpos%);
100a%=GET:A%=a%
110IFA%<>27:PROCkeys
120UNTILA%=27
130PROCsave
140PROCexit:CHAIN"TelMenu"
150:
160DEFPROCkeys
170IFA%=3:PROCzap:CALLS%:ENDPROC
180IFA%=12:PROCload:ENDPROC
190IFA%=13:PROCnewline:ENDPROC
200IFA%=16:PROCprint:ENDPROC
210IFA%=19:PROCsave:CALLS%:ENDPROC
220IFA%=23:PROCscrup:ENDPROC
230IFA%=24:PROCscrdown:ENDPROC
240IFINSTR("QWASZXqwaszx",CHR$(a%))<>0
ANDt%:PROCpixel:ENDPROC
250IFA%=135ORA%=127:PROCdelete:ENDPROC
260IFA%=136:PROCleft:ENDPROC
270IFA%=137:PROCright:ENDPROC
280IFA%=138:PROCdown:ENDPROC
290IFA%=139:PROCup:ENDPROC
300IFa%>=200ANDa%<=229:PROCfkeys
310IFA%=226:PROCinspc:ENDPROC
320IFA%=227:PROCinsline:ENDPROC
330IFA%=228:PROCdelline:ENDPROC
340IFA%=209:PROCptog:ENDPROC
350IFA%=219ORA%=229:?&7B=?&7B EOR1:dis
play%=1:ENDPROC
360IFt%=0ANDA%>31:?(buffer%+line%*80+c
ol%)=A%:PROCright:display%=1
370ENDPROC
380:
390DEFPROCfkeys
400IFa%>=200ANDa%<=208:A%=a%-71
410IFa%>=210ANDa%<=216:A%=a%-65
420IFa%>=217ANDa%<=218:A%=a%-61
430IFa%>=220ANDa%<=221:A%=a%-67
440IFa%>=222ANDa%<=223:A%=a%-64
450IFa%>=224ANDa%<=225:A%=365-a%
460ENDPROC
470:
480DEFPROCzap
490PROCask("Clear text")
500IFINSTR("Yy",CHR$(Q%))=0:ENDPROC
510CALLZ%
520ENDPROC
530:
540DEFPROCnewline
550IFline%=maxline%:VDU7:ENDPROC
560PROCdown
570IFcol%<>0:REPEAT:PROCleft:UNTILcol%
=0
580ENDPROC
590:
600DEFPROCpixel
610LOCALW%
620W%=2^((INSTR("QWASZ X",CHR$(a%AND22
3)))-1)
630K%=buffer%+line%*80+col%
640IF(?K%AND160)<>160:?K%=?K%OR160
650IF?(K%ANDW%)=W%:?K%=?K%AND(255-W%)E
LSE?K%=?K%EORW%
660display%=1
670ENDPROC
680:
690DEFPROCptog
700t%=t%EOR1
710IFt%:VDU23;10,&67;0;0;0 ELSE VDU23;
10,&60;0;0;0
720ENDPROC
730:
740DEFPROCleft
750IFpos%>0:pos%=pos%-1:col%=col%-1:EN
DPROC
760IFline%=0:VDU7:ENDPROC
770line%=line%-1:pos%=79:col%=79
780IFvpos%>0:vpos%=vpos%-1:ENDPROC
790stlinpnt%=stlinpnt%-1:display%=1
800ENDPROC
810:
820DEFPROCright
830IFpos%<79:pos%=pos%+1:col%=col%+1:E
NDPROC
840IFline%=maxline%:VDU7:ENDPROC
850line%=line%+1:pos%=0:col%=0
860IFvpos%<18:vpos%=vpos%+1:ENDPROC
870stlinpnt%=stlinpnt%+1:display%=1
880ENDPROC
890:
900DEFPROCdown
910IFline%=maxline%:VDU7:ENDPROC
920line%=line%+1
930IFvpos%<18:vpos%=vpos%+1:ENDPROC
940stlinpnt%=stlinpnt%+1:display%=1
950ENDPROC
960:
970DEFPROCscrdown
980IFstlinpnt%>=maxline%-18:VDU7:ENDPR
OC
990stlinpnt%=stlinpnt%+1:line%=line%+1
1000display%=1
1010ENDPROC
1020:
1030DEFPROCup
1040IFline%=0:VDU7:ENDPROC
1050line%=line%-1
1060IFvpos%>0:vpos%=vpos%-1:ENDPROC
1070stlinpnt%=stlinpnt%-1:display%=1
1080ENDPROC
1090:
1100DEFPROCscrup
1110IFstlinpnt%=0:VDU7:ENDPROC
1120stlinpnt%=stlinpnt%-1:line%=line%-1
1130display%=1
1140ENDPROC
1150:
1160DEFPROCdelete
1170IFA%=127:IFcol%=0:VDU7:ENDPROC
1180IFA%=127:PROCleft
1190org%=buffer%+line%*80
1200FORI%=col% TO 79:?(org%+I%)=?(org%+
I%+1):NEXT
1210org%?79=32:display%=1
1220ENDPROC
1230:
1240DEFPROCinspc
1250org%=buffer%+line%*80+col%
1260dest%=buffer%+line%*80+79
1270diff%=dest%-org%
1280FORI%=0TOdiff%
1290?(dest%-I%)=?(dest%-I%-1)
1300NEXT
1310?org%=32:display%=1
1320ENDPROC
1330:
1340DEFPROCinsline
1350LOCALP%
1360org%=&80:dest%=&84:end%=&88:stop%=&
8C
1370!org%=buffer%+(maxline%-1)*80+79
1380!dest%=buffer%+maxline%*80+79
1390!end%=buffer%+line%*80
1400!stop%=buffer%+line%*80+79
1410FORI%=0TO2STEP2
1420P%=&980
1430[OPTI%
1440LDY#0
1450.loop
1460LDA(org%),Y:STA(dest%),Y
1470LDAorg%::BNEd1
1480DECorg%+1
1490.d1
1500DECorg%
1510LDAdest%:BNEd2
1520DECdest%+1
1530.d2
1540DECdest%
1550LDAorg%+1:CMPend%+1:BNEloop
1560LDAorg%:CMPend%:BCSloop
1570RTS
1580]NEXT
1590CALL&980
1600REPEAT
1610?!end%=32
1620!end%=!end%+1
1630UNTIL!end%=!stop%+1
1640display%=1
1650ENDPROC
1660:
1670DEFPROCdelline
1680LOCALP%
1690org%=&80:dest%=&84:end%=&88:stop%=&
8C
1700!org%=buffer%+(line%+1)*80
1710!dest%=buffer%+line%*80
1720!end%=buffer%+maxline%*80+79
1730!stop%=buffer%+maxline%*80
1740FORI%=0TO2STEP2
1750P%=&980
1760[OPTI%
1770LDY#0
1780.loop
1790LDA(org%),Y:STA(dest%),Y
1800INCorg%::BNEd1:INCorg%+1
1810.d1
1820INCdest%:BNEd2:INCdest%+1
1830.d2
1840LDAend%+1:CMPorg%+1:BNEloop
1850LDAend%:CMPorg%:BCSloop
1860RTS
1870]NEXT
1880CALL&980
1890REPEAT
1900?!end%=32
1910!end%=!end%-1
1920UNTIL!end%=!stop%-1
1930display%=1
1940ENDPROC
1950:
1960DEFPROCprint
1970PROCask("Print text")
1980IFINSTR("Yy",CHR$(Q%))=0:ENDPROC
1990O%=buffer%:M%=maxline%
2000CHAIN"PRINTER"
2010:
2020DEFPROCask(message$)
2030VDU26
2040VDU28,0,1,40,1
2050REPEAT
2060CLS
2070PRINTTAB(6)message$" y/n ? ";
2080Q%=GET:IFINSTR("YyNn ",CHR$(Q%))=0A
NDQ%<>13ANDQ%<>27:VDU7
2090UNTILINSTR("YyNn ",CHR$(Q%))<>0ORQ%
=13ORQ%=27
2100CALLR%
2110VDU12,26
2120VDU28,0,21,79,2
2130display%=1
2140ENDPROC
2150:
2160DEFPROCload
2170PROCask("Load file")
2180IFINSTR("Yy",CHR$(Q%))=0:ENDPROC
2190PROCfile("Load file")
2200OSCLI("LOAD "+f$+" "+STR$÷(buffer%)
)
2210PROCinit
2220ENDPROC
2230:
2240DEFPROCsave
2250PROCask("Save file")
2260IFINSTR("Yy",CHR$(Q%))=0:ENDPROC
2270PROCfile("Save file")
2280OSCLI("SAVE "+f$+" "+STR$÷(buffer%)
+"+"+STR$÷((maxline%+1)*80))
2290ENDPROC
2300:
2310DEFPROCfile(message$)
2320*FX229,0
2330REPEAT
2340CLS
2350PRINTTAB(10)message$
2360PRINTTAB(10)"---------"
2370PRINT
2380OSCLI(".")
2390REPEAT
2400INPUTLINE'"OS command or Filename ?
"f$
2410UNTILf$<>""
2420IFINSTR(f$,"*"):OSCLIf$
2430UNTILINSTR(f$,"*")=0
2440*FX229,1
2450ENDPROC
2460:
2470DEFPROCinit
2480*FX18
2490*FX21
2500*FX4,1
2510*FX229,1
2520*FX225,200
2530*FX226,210
2540*FX227,220
2550stlinpnt%=0
2560pos%=0:vpos%=0:line%=0:col%=0
2570start%=&70
2580t%=0
2600buffer%=&6700
2610display%=1
2620VDU23;10,&60;0;0;0
2630CALLS%
2640ENDPROC
2650:
2660DEFPROCexit
2670*FX4,0
2680*FX229,0
2690VDU23;10,&67;0;0;0
2700CALLR%
2710VDU26,12
2720ENDPROC