8-Bit Software Online Conversion

:0.$.3to7 - Listing

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