8-Bit Software Online Conversion
:0.$.3to7 - Listing
10DEFFNS="3to7":REM V1.01
20REM Modified JGH 20-06-96
30IFINKEY$(0)=CHR$0:INPUT""A$:$&A00=A
$
40*FX229
50MODE7:VDU23;8202;0;0;0;
60HIMEM=&3000
70DIMscr%(20),code 350,string 80
80PROCassemble:F%=0
90ONERROR REPORT:IFINKEY-1=0:CLOSE#F%
:OSCLI"Exec $.!BOOT":END ELSE END
100A$=$&A00:IFA$="" ORLENA$>80 ORASCA$
<32 ORASCA$>126:PROCfile ELSE $&A00=""
110PRINT'CHR$(157)CHR$(132)"Colour? Y/
N"''
120?&74=(INSTR("Yy",GET$)>0)AND1
130?&72=130 AND(?&74>0):PRINT
140F%=OPENIN A$:IFF%=0:PRINTA$;" not f
ound"
150B%=&900:times%=0:back%=0:new%=0
160?&76=?&74:?&71=0
170:
180REPEAT
190IF NOTEOF#F%:new%=1:PROCld
200G%=&3000
210REPEAT:CLS:?&73=0
220REPEAT:CALLcode
230PRINT'CHR$(?&72)$string;
240UNTIL?&73>22 OR G%>=T%
250depth%=(&4000*(times%-1)+G%-&3000)/
(EXT#F%/100)
260PRINTTAB(0,0)CHR$(157)CHR$(132);RIG
HT$(" "+STR$depth%,2);"%";:*FX21
270PRINT" B : back F / forward Esc e
nd";:REPEATG$=GET$:UNTILINSTR("BbFb:*/?"
,G$)
280IFINSTR("Bb*:",G$) ANDG%>&3000:PROC
jumpback
290IFINSTR("Ff?/",G$):PROCjumpforward
300UNTILG%>=T%:UNTILFALSE
310END
320:
330DEFPROCld
340IFback%:times%=times%-1:PTR#F%=scr%
(times%)
350IFnew%:times%=times%+1:scr%(times%)
=PTR#F%
360H%=EXT#F%-PTR#F%:IFH%>&3FFF:H%=&400
0
370PRINT'CHR$(157)CHR$(132)" Loading P
lease Wait "
380A%=4:X%=B%:Y%=X%DIV256
390X%?0=F%:X%!1=&3000:X%!5=H%
400CALL&FFD1
410D%=0:back%=0:new%=0:T%=&3000+H%+D%
420IF PTR#F%=EXT#F%:ENDPROC
430S%=&6FFF
440REPEAT:D%=D%+1:S%=S%+1
450R%=BGET#F%:?S%=R%
460UNTIL?S%=13 OR ?S%=10 OR EOF#F%
470S%?1=&FF:T%=&3000+H%+D%
480ENDPROC
490:
500DEFPROCfile:REPEAT:CLS
510PRINT" 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):"'
520*.
530REPEATINPUTLINE'"Filename: "A$
540IFLEFT$(A$,1)="*":OSCLIA$
550UNTILLEFT$(A$,1)<>"*"
560UNTILA$<>""
570ENDPROC
580:
590DEFPROCjumpback
600IFG%<=&3600 AND times%=1:G%=&3000:E
NDPROC
610IFG%>&3600:G%=G%-&500:REPEAT:G%=G%-
1:UNTIL ?G%=13 OR G%=&3000:ENDPROC
620back%=1
630PROCld:G%=&6A00:REPEAT:G%=G%-1:UNTI
L ?G%=13
640ENDPROC
650:
660DEFPROCjumpforward
670IFG%>(T%-&380):ENDPROC
680REPEAT:G%=G%-1:UNTIL?G%=13
690G%=G%+1:ENDPROC
700:
710DEFPROCassemble
720strpos=string
730FOR I%=0 TO 2 STEP2
740P%=code
750[OPTI%
760JSR clear
770.loop
780JSR get
790LDX &74:BEQ a1
800LDA &404:CMP #13:BNE a1
810LDX &75:BEQ a1
820JSR chcol:JMP a2
830.a1
840LDX #0:STX &75
850LDA &404:CMP #13:BNE a2
860LDX #1:STX &75
870.a2
880LDA &404:CMP #13:BEQ a3
890CMP #126:BCS a3
900CMP #29:BEQ high
910CMP #32:BCC a3
920JSR atob:JMP a3
930.high
940LDA &71:BMI a3:½ View type
950ASL A:BMI skip:½ Extended
960½ Not yet set:
970LDY #1:LDA (&80),Y:PHA:INY
980.highLP
990LDA (&80),Y:CMP #29:BEQ high2
1000INY:BPL highLP:STY &71:BMI a3
1010.high2
1020INY:LDA (&80),Y:AND #&DF:STA &70
1030LDA #&80:STA &71
1040PLA:AND #&DF:CMP &70:BNE a3
1050LSR &71
1060.skip
1070JSR g0:½ Skip
1080.a3
1090LDA &404:CMP #13:BEQ a5
1100LDX &76:CPX #40:BEQ a5
1110LDX &41D:CPX &451:BCC a4
1120LDX &41C:CPX &450:BCS a5
1130.a4
1140JMP loop
1150.a5
1160LDX &76:CPX #40:BNE a6
1170JSR back:JMP a7
1180.a6
1190LDA &404:CMP #13:BNE a8
1200.a7
1210LDX &74:STX &76:INC &73
1220.a8
1230RTS
1240½ ******* subroutines ********
1250.clear
1260LDX #0:STX &77
1270LDA #13:STA string,X:RTS
1280.get
1290LDX &41C:STX &80
1300LDX &41D:STX &81
1310LDY #0:LDA (&80),Y:STA &404
1320.g0
1330INC &41C:BNE g1:INC &41D
1340.g1
1350RTS
1360.atob
1370INC &76
1380LDX &77:LDA &404:STA string,X
1390INX:STX &77:LDA #13:STA string,X
1400RTS
1410.chcol
1420INC &72:LDX &72
1430CPX #132:BNE c1
1440LDY #133:STY &72
1450.c1
1460CPX #135:BNE c2
1470LDY #130:STY &72
1480.c2
1490RTS
1500.back
1510LDX &41C:STX &82:LDX &41D:STX &83
1520LDX &77:STX &84
1530.bloop
1540LDY #2
1550.b0
1560LDX &41C:BNE b1:DEC &41D
1570.b1
1580DEC &41C:DEY:BNE b0
1590JSR get
1600DEC &77
1610LDA &404:CMP #32:BEQ b2
1620LDX &77:CPX#1:BNE bloop
1630LDX &84:STX &77
1640LDA #127:STA string,X
1650INX:LDA #13:STA string,X
1660LDX &82:STX &41C
1670LDX &83:STX &41D
1680RTS
1690.b2
1700LDX &77:LDA #13:STA string,X
1710.b3
1720RTS
1730]NEXT:ENDPROC