8-Bit Software Online Conversion
:0.$.3to7 - Listing
10DEFFNS="3to7"
20*FX229
30MODE7
40VDU23;8202;0;0;0;
50HIMEM=&3000
60DIMscr%(20),code 300,string 80
70PROCassemble
80F%=0
90ONERROR CLOSE#F%:OSCLI"EX.!BOOT":EN
D
100REM PROCfile
110A$=$&A00:REM REMOVE THIS LINE IF AB
OVE LINE IS ACTIVATED
120F%=OPENIN A$
130PRINT''CHR$(157)CHR$(132)"Colour? Y
/N"''
140IFINSTR("Yy",GET$) ?&74=1 ELSE ?&74
=0
150IF ?&74 ?&72=130 ELSE ?&72=0
160B%=&900:times%=0:back%=0:new%=0
170?&76=?&74
180:
190REPEAT
200IF NOT EOF#F% new%=1:PROCld
210G%=&3000
220 REPEAT
230 ?&73=0
240 REPEAT
250 CALL code
260 PRINT'CHR$(?&72)$string;
270 UNTIL ?&73>19 OR G%>=T%
280 depth%=(&4000*(times%-1)+G%-&3000)
/(EXT#F%/100)
290 PRINTTAB(0,0)CHR$(157)CHR$(132);
300 IF depth%<10 PRINT" ";
310 PRINTSTR$(depth%)"%";
320*FX21
330 IF EOF#F% AND G%>=T% PRINT" ESC
APE Finishes, or (B)ack. ";TAB(39,24);
:REPEAT:G$=GET$:UNTILINSTR("Bb",G$) ELSE
PRINT" Any Key, or (B)ack, (F)orwar
d.";TAB(39,24);:G$=GET$
340 IFINSTR("Bb",G$) PROCjumpback
350 IFINSTR("Ff",G$) PROCjumpforward
360 UNTILG%>=T%
370UNTILFALSE
380END
390:
400DEFPROCld
410IFback%:times%=times%-1:PTR#F%=scr%
(times%)
420IFnew%:times%=times%+1:scr%(times%)
=PTR#F%
430IF EXT#F%-PTR#F%>&3FFF H%=&4000 ELS
E H%=EXT#F%-PTR#F%
440PRINT'CHR$(157)CHR$(132)" Loading P
lease Wait "
450A%=4
460X%=B% MOD 256
470Y%=B% DIV 256
480B%?0=F%
490B%!1=&3000
500B%!5=H%
510CALL&FFD1
520D%=0:back%=0:new%=0:T%=&3000+H%+D%
530IF PTR#F%=EXT#F% ENDPROC
540S%=&6FFF
550REPEAT
560D%=D%+1
570S%=S%+1
580R%=BGET#F%
590?S%=R%
600UNTIL?S%=13 OR ?S%=10 OR EOF#F%
610S%?1=&FF
620T%=&3000+H%+D%
630ENDPROC
640:
650DEFPROCfile
660REPEAT
670CLS
680PRINT" 8-Bit Software 80 to 40 Colu
mn"'" Text Conversion. By C.J.Richardson
."'" Please enter filename to Convert, o
r"'" '*' command (eg *DRIVE 2):"'
690*.
700PRINT'"Filename :"
710INPUT A$
720IF LEFT$(A$,1)="*" OSCLI+A$
730UNTILLEFT$(A$,1)<>"*"
740ENDPROC
750:
760DEFPROCjumpback
770PRINT'CHR$(157)CHR$(132)" Jump Back
"
780IFG%<=&3600 AND times%=1:G%=&3000:E
NDPROC
790IFG%>&3600:G%=G%-&600:REPEAT:G%=G%-
1:UNTIL ?G%=13 OR G%=&3000:ENDPROC
800back%=1
810PROCld:G%=&6A00:REPEAT:G%=G%-1:UNTI
L ?G%=13
820ENDPROC
830:
840DEFPROCjumpforward
850IFG%>(T%-&380) ENDPROC
860G%=G%+&300
870REPEAT:G%=G%+1:UNTIL?G%=13
880PRINT'CHR$(157)CHR$(132)" Jump Forw
ard"
890ENDPROC
900:
910DEFPROCassemble
920strpos=string
930FOR I%=0 TO 2 STEP 2
940P%=code
950[OPTI%
960JSR clear
970.loop
980JSR get
990LDX &74:BEQ a1
1000LDA &404:CMP #13:BNE a1
1010LDX &75:BEQ a1
1020JSR chcol:JMP a2
1030.a1
1040LDX #0:STX &75
1050LDA &404:CMP #13:BNE a2
1060LDX #1:STX &75
1070.a2
1080LDA &404:CMP #13:BEQ a3
1090CMP #126:BCS a3
1100CMP #32:BCC a3
1110JSR atob
1120.a3
1130LDA &404:CMP #13:BEQ a5
1140LDX &76:CPX #40:BEQ a5
1150LDX &41D:CPX &451:BCC a4
1160LDX &41C:CPX &450:BCS a5
1170.a4
1180JMP loop
1190.a5
1200LDX &76:CPX #40:BNE a6
1210JSR back:JMP a7
1220.a6
1230LDA &404:CMP #13:BNE a8
1240.a7
1250LDX &74:STX &76:INC &73
1260.a8
1270RTS
1280½ ******* subroutines ********
1290.clear
1300LDX #0:STX &77
1310LDA #13:STA string,X:RTS
1320.get
1330LDX &41C:STX &80
1340LDX &41D:STX &81
1350LDY #0:LDA (&80),Y:STA &404
1360INC &41C:BNE g1:INC &41D
1370.g1
1380RTS
1390.atob
1400INC &76
1410LDX &77:LDA &404:STA string,X
1420INX:STX &77:LDA #13:STA string,X
1430RTS
1440.chcol
1450INC &72:LDX &72
1460CPX #132:BNE c1
1470LDY #133:STY &72
1480.c1
1490CPX #135:BNE c2
1500LDY #130:STY &72
1510.c2
1520RTS
1530.back
1540LDX &41C:STX &82:LDX &41D:STX &83
1550LDX &77:STX &84
1560.bloop
1570LDY #2
1580.b0
1590LDX &41C:BNE b1:DEC &41D
1600.b1
1610DEC &41C:DEY:BNE b0
1620JSR get
1630DEC &77
1640LDA &404:CMP #32:BEQ b2
1650LDX &77:CPX#1:BNE bloop
1660LDX &84:STX &77
1670LDA #127:STA string,X
1680INX:LDA #13:STA string,X
1690LDX &82:STX &41C
1700LDX &83:STX &41D
1710RTS
1720.b2
1730LDX &77:LDA #13:STA string,X
1740.b3
1750RTS
1760]NEXT:ENDPROC