8-Bit Software Online Conversion
:2.$.ASCPROG - Listing
10MODE3
20VDU23;11,8;0;0;0:?&88=1:PROCmode
22*FX12,25
30*FX4,1
40*FX21,0
60ONERROR PROCerror
70VDU3:CLS
80IF ?!&74<>&FF THEN PROCclear
90?&8F=0:cls=0:PROCpscreen
100REPEAT
110A%=GET
120IF A%=16 OR A%=135 OR A%>147 THEN P
ROCfunctions
130IF A%=1 THEN PROCscrollup
140IF A%=13 THEN PROCinsert
150IF A%=26 THEN PROCscrolldown
160IF A%>31 AND A%<127 THEN PROCinsert
170IF A%=127 THEN PROCdelete
180IF A%=136 THEN PROCleft
190IF A%=137 THEN PROCright
200IF A%=138 AND VPOS<23 THEN PROCdown
210IF A%=139 THEN PROCup
220IF A%=144 THEN N%=0:PROCdir
230IF A%=145 THEN N%=1:PROCdir
240IF A%=146 THEN N%=2:PROCdir
250IF A%=147 THEN N%=3:PROCdir
260PROCpscreen:?&8F=1
268IF VPOS=24 THEN PROCleft:PROCpscree
n
270UNTIL FALSE
280
290DEFPROCfunctions
300VDU28,0,24,79,20,12,28,30,24,60,20
310IF A%=16 THEN PROCprinter
320IF A%=135 THEN PROChome
330IF A%=148 THEN PROCload
340IF A%=149 THEN PROCsave
350IF A%=150 THEN PROCzap
360IF A%=151 THEN PROCmode
370IF A%=152 THEN PROCjump
380IF A%=153 THEN PROCdir:S%=GET
390CLS:ENDPROC
400
410DEFPROCmode
420?&88=?&88 EOR 1
430IF ?&88 THEN VDU23;10,&60;0;0;0 ELS
E VDU23;10,&68;0;0;0
440?&8F=0:cls=1:ENDPROC
450
460DEFPROCleft
470IF !&7C<>!&70 AND !&7C<>!&78 THEN !
&7C=!&7C-1
480ENDPROC
490
500DEFPROCright
520IF !&7C<>!&74 THEN !&7C=!&7C+1
530ENDPROC
540
550DEFPROCup
560IF !&7C=!&70 THEN ENDPROC
570IF !&7C=!&78 AND A%=139 THEN ENDPRO
C
580B%=0
590REPEAT
600!&7C=!&7C-1
610IF !&7C=!&70 THEN B%=2
620IF ?(!&7C)=13 THEN B%=B%+1
630UNTIL B%>1
640IF !&7C=!&70 THEN ENDPROC
650PROCdown:ENDPROC
660
670DEFPROCdown
690IF !&7C=!&74 THEN ENDPROC
700B%=0
710REPEAT
720IF ?(!&7C)=13 THEN B%=1
730!&7C=!&7C+1
740IF !&7C=!&74 THEN B%=1
750UNTIL B%=1
760ENDPROC
770
780DEFPROCscrollup
790IF !&78<>!&70 THEN !&7C=!&78:PROCup
:!&78=!&7C:CLS:?&8F=0
800ENDPROC
810
820DEFPROCscrolldown
830IF !&78<>(!&74-&100) THEN !&7C=!&78
:PROCdown:!&78=!&7C:CLS:?&8F=0
840ENDPROC
850
860DEFPROCdelete
870IF !&7C<>!&78 THEN !&80=!&7C-1:CALL
Y%:!&74=!&74-1:!&7C=!&7C-1:CLS:?&8F=0
890ENDPROC
900
910DEFPROCinsert
920IF ?&88=0 OR A%=13 OR ?!&7C=13 OR !
&7C=!&74 THEN !&80=!&74:CALL Z%:!&74=!&7
4+1:?(!&7C+1)=?!&7C
940?!&7C=A%:!&7C=!&7C+1:CLS:?&8F=0
950ENDPROC
960
970DEFPROCjump
980cls=1:?&8F=0
990!&80=0:D%=-1:B%=0:C%=0:CALL X%
1000PRINT'STR$(B%);" LINES SPACE LEFT
=";STR$(&4000-!&74)
1010PRINT"CURRENT LINE = ";STR$(C%)
1020INPUT"GOTO WHICH LINE ? "'N$
1030IF N$="" THEN ENDPROC
1040D%=VAL(N$)
1050IF D%<1 THEN !&78=!&70:!&7C=!&70:EN
DPROC
1060IF D%>B% THEN D%=B%
1070B%=0:C%=0:CALL X%
1080!&78=!&80:!&7C=!&80
1090ENDPROC
1100
1110DEFPROCpscreen
1120IF !&70=!&74 THEN ENDPROC
1130VDU26,30
1140IF cls THEN CLS
1150D%=!&7C-!&78
1160VDU23,1,0;0;0;0;0
1170?&40A=?&8F:CALL W%
1180VDU23,1,1;0;0;0;0
1190cls=0:?&8F=1
1200ENDPROC
1210
1220DEFPROCload
1230?&8F=0:PROCcheck("LOAD FILE")
1240IF Q% THEN CLS ELSE ENDPROC
1250REPEAT
1260INPUT'"ENTER FILE NAME OR ? "''$&90
0
1270IF $&900="?" THEN PROCdir
1280UNTIL $&900<>"?"
1290F%=OPENIN(":"+STR$(N%)+"."+$&900)
1300IF F% THEN PROCclear:!&74=!&70 ELSE
ENDPROC
1310REPEAT
1320B%=BGET#F% AND &7F
1330IF B%=13 OR B%>31 THEN ?!&74=B%:!&7
4=!&74+1
1340UNTIL EOF#F% OR B%=0
1350CLOSE#F%:?!&74=&FF:!&78=!&70:!&7C=!
&70
1360ENDPROC
1370
1380DEFPROCdir
1400VDU26:CLS:OSCLI".:"+STR$(N%)
1410VDU28,30,24,60,20:cls=1
1420?&8F=0:ENDPROC
1430
1440DEFPROCsave
1450?&8F=0:PROCcheck("SAVE FILE")
1460IF Q% THEN CLS ELSE ENDPROC
1470REPEAT
1480PRINT'"Current name is ";$&900
1490INPUT'"<RETURN> or newname or ? "''
N$
1500IF N$="?" THEN PROCdir
1510IF N$<>"" THEN $&900=N$
1520UNTIL $&900<>"?"
1530F%=OPENOUT(":"+STR$(N%)+"."+$&900)
1540I%=!&70
1550REPEAT
1560BPUT#F%,?I%:I%=I%+1
1570UNTIL ?I%=&FF OR ?I%=0
1580CLOSE#F%
1590ENDPROC
1600
1610DEFPROCclear
1620!&70=TOP+&100:!&78=!&70:!&7C=!&70:?
!&70=&20:!&74=!&70+1:?!&74=&FF:VDU26:CLS
1630ENDPROC
1640
1650DEFPROCzap
1660?&8F=0:PROCcheck("ZAP THIS FILE")
1670IF Q% THEN PROCclear
1680ENDPROC
1690
1700DEFPROCprinter
1710?&8F=0:PROCcheck("PRINT FILE")
1720IF Q% THEN CLS ELSE ENDPROC
1730REPEAT
1740PRINT'"Current name is ";$&900
1750INPUT'"<RETURN> or newname or ? "''
N$
1760IF N$="?" THEN PROCdir
1770IF N$<>"" THEN P$=N$ ELSE P$=$&900
1780UNTIL $&900<>"?"
1782*FX6,13
1790VDU2
1800OSCLI("TYPE :"+STR$(N%)+"."+P$)
1810VDU3
1820ENDPROC
1830
1840DEFPROChome
1850?&8F=0:PROCcheck("HOME CURSOR")
1860IF Q% THEN !&7C=!&78:cls=1
1870ENDPROC
1880
1890DEFPROCcheck(T$)
1900PRINT'T$;" Y/N ? "
1910Q%=0:A$=GET$
1920IF INSTR("Yy",A$) THEN Q%=1
1930ENDPROC
1940
1950DEFPROCerror
1960cls=1:PROCpscreen
1970ENDPROC