8-Bit Software Online Conversion
Notepad Suite - Listing
10*TV255
20*FX21
30*FX4,1
40*KEY10"OLD|M"
50MODE7
60VDU23,1,0;0;0;0;
70BKST$=CHR$(133)+CHR$(157)+CHR$(134)
80BKND$=CHR$(131)+CHR$(157)
100ch%=0
110REPEAT
120ch%=ch%+1:IFch%>5:ch%=1
130VDU30
150PRINTBKND$
180RESTORE
190FORI=1TO23:READdo$
200A$=MID$(do$,1,1):IFch%=1 AND A$<>"
":A$=CHR$(ASC(A$)EOR&20)
210B$=MID$(do$,2,1):IFch%=2 AND B$<>"
":B$=CHR$(ASC(B$)EOR&20)
220C$=MID$(do$,3,1):IFch%=3 AND C$<>"
":C$=CHR$(ASC(C$)EOR&20)
230D$=MID$(do$,4,1):IFch%=4 AND D$<>"
":D$=CHR$(ASC(D$)EOR&20)
240E$=MID$(do$,5,1):IFch%=5 AND E$<>"
":E$=CHR$(ASC(E$)EOR&20)
250PRINTBKND$" "BKST$A$" "BKND$BKST$B$
" "BKND$BKST$C$" "BKND$BKST$D$" "BKND$BK
ST$E$" "BKND$
260NEXT
270PRINTBKND$;
272PRINTTAB(ch%*7,4)CHR$(8)CHR$(255)
280PRINTTAB(ch%*7,20)CHR$(8)CHR$(255)
290Q%=GET
292PRINTTAB(ch%*7,4)CHR$(8)" "
300PRINTTAB(ch%*7,20)CHR$(8)" "
310UNTILQ%=13
320:
330DATA" "
332DATA" "
334DATA" "
336DATA" "
338DATA" "
340DATA" m "
350DATA"cow "
360DATA"oned "
370DATA"mtean"
380DATA"phkio"
390DATA"elllt"
400DATA"nyyye"
410DATA"d p"
420DATA"iddda"
430DATA"uiiid"
440DATA"maaa "
450DATA" rrr "
460DATA" yyy "
470DATA" "
472DATA" "
474DATA" "
476DATA" "
478DATA" "
480:
490IFch%=1:F$="compend"
500IFch%=2:CHAIN"Mdiary"
510IFch%=3:CHAIN"Wdiary"
520IFch%=4:CHAIN"Ddiary"
530IFch%=5:CHAIN"NotePad"
540:
550buffer=&4000
560bufsize=&3000
570HIMEM=buffer
580DIMcode 400,scr%(20)
590ONERROR RUN
600*FX4,1
610PROCassemble
620REMPROCfile
630F%=OPENIN F$
640REM" Colour toggles on c
650?&74=1:?&72=130
660B%=&900:times%=0:back%=0:new%=0
670div=EXT#F%/100
680:
690REPEAT
700new%=1:PROCld
710REPEAT
720start%=G%:?&73=0:scol%=?&72
730REPEAT
740CALL gline
750UNTIL ?&73=24 OR G%>=T%
760IF ?&73<>24:REPEAT:PRINTSTRING$(40,
" ");:?&73=?&73+1:UNTIL ?&73=24
770depth=(bufsize*(times%-1)+G%-buffer
)/div
780REPEAT
790PRINTTAB(0,24)CHR$(157)CHR$(132);
800IF depth<10 PRINT" ";
810IF depth<100 PRINT" ";
820PRINTSTR$(INT(depth))"%";
830IF EOF#F% AND G%>=T% PRINTCHR$(136)
" Any Key Finishes or B,[ "; ELSE PRINT
" Any Key [,],B,F or P ";
840IFstart%=buffer:VDU7:E%=1:PRINT"(TO
B) ";
850IFE%=0:IFG%>=T%:VDU7:E%=1:PRINT"(BO
B) ";
860IFE%:E%=0 ELSE PRINT" ";
870PRINTTAB(0,24);
880*FX21
890K%=GET:G$=CHR$(K%)
900IF K%=136 OR K%=139 PROCback1
910IF K%=137 OR K%=138 PROCforward1
920IFINSTR("Bb",G$) PROCjumpback
930IFINSTR("Ff",G$) PROCjumpforward
940IFINSTR("Cc",G$) PROCcolour
950IFINSTR("Pp",G$) PROCprtScreen
960UNTIL K%
970UNTILG%>=T%
980UNTILEOF#F%
990:
1000CLOSE#F%
1010*FX4,0
1020RUN
1030END
1040:
1050DEFPROCcolour
1060?&74=?&74 EOR 1
1070IF ?&74 ?&72=130 ELSE ?&72=0
1080G%=start%
1090ENDPROC
1100:
1110DEFPROCcolminus
1120?&72=?&72-1
1130IF?&72=132:?&72=131
1140IF?&72=129:?&72=134
1150ENDPROC
1160:
1170DEFPROCcolplus
1180?&72=?&72+1
1190IF?&72=132:?&72=133
1200IF?&72=135:?&72=130
1210ENDPROC
1220:
1230DEFPROCld
1240IFback% times%=times%-1:PTR#F%=scr%
(times%)
1250IFnew%:times%=times%+1:scr%(times%)
=PTR#F%
1260IF EXT#F%-PTR#F%>(bufsize-1) H%=buf
size ELSE H%=EXT#F%-PTR#F%
1270PRINTTAB(0,24)CHR$(157)CHR$(132)" L
oading Please Wait ";TAB(
0,24);
1280A%=4
1290X%=B% MOD 256
1300Y%=B% DIV 256
1310B%?0=F%
1320B%!1=buffer
1330B%!5=H%
1340CALL&FFD1
1350D%=0:back%=0:new%=0:G%=buffer:T%=G%
+H%+D%
1360IF PTR#F%=EXT#F% ENDPROC
1370S%=&6FFF
1380REPEAT
1390D%=D%+1
1400S%=S%+1
1410R%=BGET#F%
1420?S%=R%
1430UNTIL?S%=13 AND ?(S%-1)=13
1440S%?1=&FF
1450T%=G%+H%+D%
1460ENDPROC
1470:
1480DEFPROCfile
1490REPEAT
1500*.
1510PRINT'"Filename :";
1520INPUT F$
1530IF LEFT$(F$,1)="*" OSCLI+F$
1540UNTILLEFT$(F$,1)<>"*"
1550ENDPROC
1560:
1570DEFPROCback1
1580IFstart%=buffer:IFtimes%>1:G$="B":E
NDPROC
1590IFstart%=buffer:K%=0:ENDPROC
1600?&72=scol%
1610IF?&74:IF?start%=13:PROCcolminus
1620VDU30:G%=start%-1
1630REPEAT:G%=G%-1:UNTIL ?G%=13 OR G%=&
3000
1640IF G%<>buffer:G%=G%+1
1650ENDPROC
1660:
1670DEFPROCforward1
1680IFG%>=T%:G$="F":ENDPROC
1690?&72=scol%
1700VDU30:G%=start%-1
1710REPEAT:G%=G%+1:UNTIL ?G%=13
1720G%=G%+1
1730IF?&74:IF ?G%=13 PROCcolplus
1740ENDPROC
1750:
1760DEFPROCjumpback
1770IFG%<=(buffer+&600) AND times%=1:G%
=buffer:ENDPROC
1780IFG%>(buffer+&600):G%=G%-&600:REPEA
T:G%=G%-1:UNTIL ?G%=13 OR G%=buffer:ENDP
ROC
1790back%=1
1800PROCld:G%=&6A00:REPEAT:G%=G%-1:UNTI
L ?G%=13
1810ENDPROC
1820:
1830DEFPROCjumpforward
1840IFG%>(T%-&380):ENDPROC
1850G%=G%+&300
1860REPEAT:G%=G%+1:UNTIL?G%=13
1870ENDPROC
1880:
1890DEFPROCprtScreen
1900U%=start%:E%=0:cnt%=0:VDU2
1910REPEAT
1920REPEAT
1930A%=?U%
1940IFA%=141:E%=1
1950IFA%>126:A%=32
1960IFA%>31:VDU1,A%
1970U%=U%+1
1980UNTIL?U%=13 OR U%>T%
1990IFE%:REPEAT:U%=U%+1:UNTIL?U%=13:cnt
%=cnt%+1:VDU1,13:E%=0
2000cnt%=cnt%+1:VDU1,13
2010UNTILcnt%=24 OR U%>T%
2020VDU1,13,3:K%=0
2030ENDPROC
2040:
2050DEFPROCerror
2060CLOSE#F%
2070*FX4,0
2080PRINT
2090ENDPROC
2100:
2110DEFPROCassemble
2120FOR I%=0 TO 2 STEP 2
2130P%=code
2140[OPTI%
2150.gline
2160LDX &74:STX &76
2170LDA &72:JSR &FFEE
2180.loopa
2190JSR get
2200CMP #13:BEQ a2
2210CMP #126:BCS a1
2220CMP #32:BCC a1
2230JSR &FFEE:INC &76
2240.a1
2250LDX &76:CPX #40:BNE loopa
2260INC &7F
2270.a2
2280LDX &74:BEQ a3
2290JSR seeatg:CMP #13:BNE a3
2300LDX &7F:BEQ d2
2310LDA &404:PHA
2320JSR get:JSR seeatg
2330LDX &41C:BNE d1:DEC &41D
2340.d1
2350DEC &41C
2360TAX:PLA:STA &404
2370CPX #13:BNE a3
2380.d2
2390JSR chcol
2400.a3
2410LDX #0:STX &7F
2420LDA &404:CMP #13:BNE a4
2430LDA #32
2440.cloop
2450LDX &76:CPX #40:BEQ a4
2460JSR &FFEE:INC &76:BNE cloop
2470.a4
2480LDA &404:CMP #13:BEQ a5
2490CMP #32:BEQ a5:JSR back
2500.a5
2510INC &73
2520RTS
2530½ ******* subroutines ********
2540.get
2550LDX &41C:STX &80
2560LDX &41D:STX &81
2570LDY #0:LDA (&80),Y:STA &404
2580INC &41C:BNE g1:INC &41D
2590.g1
2600RTS
2610.seeatg
2620LDX &41C:STX &80
2630LDX &41D:STX &81
2640LDY #0:LDA (&80),Y
2650RTS
2660.chcol
2670INC &72:LDX &72
2680CPX #132:BNE c1
2690LDY #133:STY &72
2700.c1
2710CPX #135:BNE c2
2720LDY #130:STY &72
2730.c2
2740RTS
2750.back
2760JSR seeatg
2770CMP #32:BEQ b0
2780CMP #13:BNE b2
2790.b0
2800INC &41C:BNE b1:INC &41D
2810.b1
2820RTS
2830.b2
2840LDX &41C:STX &82:LDX &41D:STX &83
2850LDX #0:STX &75
2860.loopb1
2870LDY #2
2880.b3
2890LDX &41C:BNE b4:DEC &41D
2900.b4
2910DEC &41C:DEY:BNE b3
2920JSR get:INC &75:DEC &76
2930CMP #32:BEQ b6
2940LDX &76:CPX &74:BNE loopb1
2950.b5
2960LDX #0:STX &75
2970LDX &82:STX &41C
2980LDX &83:STX &41D
2990JSR seeatg:CMP #13:BNE b6
3000INC &41C:BNE b6:INC &41D
3010.b6
3020LDX &75:BEQ b7:LDA #127
3030.loopb2
3040JSR &FFEE:DEC &75:BNE loopb2
3050JSR &FFE7
3060.b7
3070RTS
3080]NEXT:ENDPROC