> ZXConv 1.16 :Close_All::exit(): *ctrl% 31,name% 127:X%=ctrl%:Y%=X%256 (4A$=OS_GetEnv:in$="":out$="":os%>31:Win_TextIO 2Aint$=type:A%=A$+" "," "):A%:in$=A$,A%-1):A$=s(A$,A%+1)) ""out$=""):usage:exit(0): Zln%=A$,"-n"):vb%=A$,"-v") dcin$="":"Input file: "in$:"Input type (Basic/BBC/Devpac/Text) "int$:uc(int$)="BBC":int$="A" njout$="":"Output file: "out$:"Output type (Basic/BBC/Devpac/Text) "outt$:uc(outt$)="BBC":outt$="A" x+int$=uc(int$,1)):outt$=uc(outt$,1)) !int$="A":outt$<>"B":fail: -int$="B":outt$<>"A":outt$<>"T":fail: !int$="D":outt$<>"T":fail: !int$="T":outt$<>"D":fail: @in%=f_openin(in$):in%=0:"Can't open '"in$"'":exit(214): Qout%=f_openout(out$):out%=0:"Can't open '"out$"'":#in%:in%=0:exit(192): int$="A":AtoB:exit(0): )int$="B":outt$="A":BtoA:exit(0): )int$="B":outt$="T":BtoT:exit(0): int$="D":DtoT:exit(0): int$="T":TtoD:exit(0): $"Unknown filetype":exit(127): -fail:"Can't convert file":exit(127):  Eusage:"Usage: ZXConv [-type] [-type] [options]":  help " " file type: -b ZX Basic" ,12"-bbc BBC BASIC" 612"-d Devpac" @12"-t Text" J)" options: -h Display full help" T"12"-n Output line numbers" ^12"-v Verbose" h rݤtype:t$ |,uc(A$,4))="-BBC":t$="A":A$=A$,6):=t$ ;A$,1)="-":"BCDMSTZ",uc(A$,2,1))):t$=uc(A$,2,1)) ;t$<>"":A%=A$+" "," "):A$=s(A$,A%+1)):t$="Z":t$="B" =t$  BtoT BasInit: line%=256*#in%+#in% len% =#in%+256*#in% wr(out%,d(line%,4)+" ") A%=#in%:A%=13:A%=10 !A%=14:#in%=#in%+5:A%=#in% .A%<165:#out%,A%wr(out%,token$(A%-165))  A%=10 #in%:SetAddr(out$,-1,0)   DtoT  &#in%+2>#in%:: 08line%=#in%+256*#in%:ln%:wr(out%,d(line%,5)+" ") :)A$=rd(in%):TtoDchk:wr(out%,A$+10) D#in%:SetAddr(out$,-1,0) N X TtoDchk bA$,3)="END":A$=A$+"IF": lA%=0::A%=A$,"#",A%+1) vSA%:B$=A$,A%+1,1):(B$>="0"B$<"9")(B$>"A"B$<"F"):A$=A$,A%-1)+"&"+A$,A%+1)  A%=0:  TtoD line%=0::line%=line%+10 '#out%,line%:#out%,line%256:A$="" A%=#in%:A%=10:A%=13 #A$=A$+A%:A%=13#in%:TtoDchk !A%=1A$:#out%,A$,A%,1): '#in%:SetAddr(out$,&3FFFF,&3FFFF)   TtoDchk #A$,5)="ENDIF":A$=A$,A$-2): A%=0::A%=A$,"&",A%+1) SA%:B$=A$,A%+1,1):(B$>="0"B$<"9")(B$>"A"B$<"F"):A$=A$,A%-1)+"#"+A$,A%+1)  A%=0:  4BasInit:token%(90),token$(90),mem% 7:_=0:_%=0 -n%=090:token%(n%),token$(n%)::copy%=   *P&B3,RND,&BF,INKEY$,&AF,PI,&A4,FN,&2800B0,POINT(,0,SCREEN$,0,ATTR,0,AT,0,TAB 4]&24BB,VAL$,0,CODE,&BB,VAL,&A9,LEN,&B5,SIN,&9B,COS,&B7,TAN,&98,ASN,&95,ACS,&99,ATN,&AA,LN >Z&A1,EXP,&A8,INT,&B6,SQR,&B4,SGN,&94,ABS,0,PEEK,0,IN,&BA,USR,&C3,STR$,&BD,CHR$,&AC,NOT HV0,BIN,&84,OR,&80,AND,0,<=,0,>=,0,<>,&86,LINE,&8C,THEN,&B8,TO,&88,STEP,&A4DD,DEFFN RH0,CAT,0,FORMAT,0,MOVE,0,ERASE,0,OPEN#,&23D9,CLOSE#,0,MERGE,0,VERIFY \D0,BEEP,0,CIRCLE,0,INK,0,PAPER,0,FLASH,0,BRIGHT,0,INVERSE,0,OVER fR0,OUT,&F14C,LPRINT,&C94C,LLIST,&FA,STOP,&F3,READ,&DC,DATA,&F7,RESTORE,&CA,NEW pV0,BORDER,0,CONTINUE,&DE,DIM,&F4,REM,&E3,FOR,&E5,GOTO,&E4,GOSUB,&E8,INPUT,&C8,LOAD zQ&C9,LIST,&E9,LET,0,PAUSE,&ED,NEXT,0,POKE,&F1,PRINT,&F0,PLOT,&F9,RUN,&CD,SAVE D0,RANDOMIZE,&E7,IF,&DB,CLS,&DF,DRAW,&D8,CLEAR,&F8,RETURN,0,COPY  BtoA 9BasInit:#out%,13:Line$="":Last$="":line%=256*#in% ;line%<&4000:line%=line%+#in%:vb%:" "+line%,5); [line%<&4000:num%=#in%+256*#in%:n%=1num%:A%=#in%:SpecByte:Last$=A%::Out:vb%: <#in%line%>&3FFF:#out%,&FF:SetAddr(out$,&FFFFFB00,0)  SpecByte GA%=13(A%>31A%<127)(A%>127A%<165):Line$=Line$+A%:A%,vb%);: 'A%=14:m%=15:B%=#in%::n%=n%+5: !A%<32:"["+~A%+"]",vb%);: A%=127:Line$=Line$+"(C)": ;Here$=token$(A%-165):A%>195Last$<165:Here$=" "+Here$ vb%:Here$;" "; %A%=&E5A%=&ECA%=&ED:SpecLine: )token%(A%-165)=0:Line$=Line$+Here$: $ULine$=Line$+token%(A%-165):token%(A%-165)>255:Line$=Line$+(token%(A%-165)256) . 8.SpecLine:Line$=" "+Line$+(&E5-(A%-&EC)) BAdest%=0:B%=#in%:n%=n%+1:B%<48B%>57:#in%=#in%-1:n%=n%-1: LGdest%=dest%*10+B%-48::B%=#in%:n%=n%+1:B%>32:dest%=dest%*10+B%-48 V3B%=14:m%=15:B%=#in%::n%=n%+5:vb%:;dest%; `zLine$=Line$+141+(((dest%&C0)&40)4+((dest%&C000)&4000)&1000)+((dest%&3F)&40)+(((dest%&3F00)&4000)&100): j Out t!#out%,line%256:#out%,line% ~##out%,3+Line$:wr(out%,Line$)   AtoB /BasInit:A%=#in%:Line$="":line%=256*#in% ;line%<&FF00:line%=line%+#in%:vb%:" "+line%,5); Gline%<&FF00:num%=#in%:n%=1num%-3:Line$=Line$+#in%::BeebLine <#in%line%>&FEFF:len%=#out%:SetAddr(out$,&8000,len%)  BeebLine:Qt%=0:Len%=0 0#out%,line%256:#out%,line%:lenptr%=#out% #out%,0:#out%,0 +n%=1Line$:A%=Line$,n%,1):BeebByte MOut$<>"":m%=1Out$:#out%,Out$,m%,1):Len%=Len%+1::Out$=206:DefFn   ptr%=#out%:#out%=lenptr% #out%,Len%:#out%,Len%256 #out%=ptr%:vb%: ( 2DefFn:Line$,"(")=0: ="0"A%<="9")):Number: =A%=13(A%>31A%<60)(A%>90A%<127)(Qt%2):A%,vb%);: !A%<32:"["+~A%+"]",vb%);: Qt%:A%,vb%);: A%=141:GotoGosub: A%>127:Token(176,255): A%>127:Token(165,176): "Z"Qt%:A%,vb%);: TokenStr(205,255): TokenStr(165,205):  vb%:A%  *Number:_=Line$,n%):_%=_:vb%:;_; 3Out$="":Out$=Out$+A%:n%=n%+1:A%=Line$,n%,1) "'A%<>"."(A%<"0"A%>"9"):n%=n%-1 ,1Out$=Out$+14+_%?0+_%?1+_%?2+_%?3+_%?4: 6ݤ_ @ _=_:!mem%=0:mem%!2=_:=mem% J ?&FFF7=&6C:=3+(!&4BE)&FFFF T>&8000:|mem%=_:=mem% ^"DEFFN_":=0 h ݤTokenStr(St%,En%):t%=St%: rLine$,n%,token$(t%-165))=token$(t%-165):Out$=t%:T%=token%(t%-165):n%=n%+token$(t%-165)-1:token$(t%-165),vb%);" ",Line$,n%+1,1)=" "),vb%);:n%=n%-(Line$,n%+1,1)=" ") |(t%=t%+1:t%>En%Out$<>A%:=TokenChk ݤToken(St%,En%) BA%=&C7:Line$,n%+1)=&95:n%=n%+1:"LOAD",vb%);:Out$=&EF:= BA%=&C7:Line$,n%+1)=&9A:n%=n%+1:"SAVE",vb%);:Out$=&F8:=  t%=St%: |T%=token%(t%-165):(T%&FF)=A%:Out$=t%:token$(t%-165),vb%);" ",Line$,n%+1,1)=" "),vb%);:n%=n%-(Line$,n%+1,1)=" ") (t%=t%+1:t%>En%Out$<>A%:=TokenChk ݤTokenChk Out$,1)=&EA:Qt%=Qt%2 6Out$<>A%:(T%&FF00)256=Line$,n%+1,1):n%=n%+1 6Out$<>A%:T%=(T%&FF0000)65536:T%:Out$=Out$+T% =Out$<>A% QGotoGosub:dest%=Line$,n%+1)+256*Line$,n%+2)+65536*Line$,n%+3):n%=n%+3 ^dest%=((dest%&FF00)&100)((dest%&30)*4)((dest%&FF0000)&100)((dest%&3)*&4000)&4000 vb%:;dest%; JOut$=dest%:_=dest%:_%=_:Out$=Out$+14+?_%+_%?1+_%?2+_%?3+_%?4: 3SetAddr(A$,ld%,ex%):#out%:out%=0:#in%:in%=0 &?X%!2=ld%:A%=file(A$,2):X%!6=ex%:A%=file(A$,3):end(0): 0ex%=0:os%<8:"Stamp "+A$ : DLݤfile(A$,A%):<&FFFFF:$name%=A$:?X%=name%:X%?1=name%256:=(&FFDD)&FF N=0 X!ݤf_openin(A$)=(f_name(A$)) b"ݤf_openout(A$)=(f_name(A$)) lVݤf_name(A$):os%>31:A%,B%:B%=A%:A%=A$,"\",A%+1):A%=0:A$,".",B%)=0:A$=A$+"." v=A$ Close_All "in%=in%:in%:A%=in%:in%=0:#A% 'out%=out%:out%:A%=out%:out%=0:#A%  $ݤd(A%,N%):=" "+A%,N%) /ݤs(A$):A$,1)=" ":A$=A$,2):A$,1)<>" " +A$,1)=" ":A$=A$,A$-1):A$,1)<>" " =A$ ݤuc(A$):B$:A$="":="" 5B$=B$+(A$((A$<"@")&DF)):A$=A$,2):A$="":=B$ wr(o%,A$):A$="": !A%=1A$:#o%,A$,A%,1):: :ݤOS_GetEnv:A$,A%,X%,Y%:X%=1:os%=((&FFF4)&FF00)256 Mos%>31:>&FFFFF:X%256:ș"GetModuleFileName",0,X%,255:run$=$$X%:=@cmd$  CA%=&600-&7B00*(>&8000)-&3F00*(>&C000):!(-&100)=@%:A%=-&300 ;?(P-3)=0:A%=&100:<&FFFF:A%=-&300:!(+512)=@%:A%=  cA$=$A%:=&8F00:run$=A$:ș16A$,,A%:ș72,"",A%:A$=A$,1+A$+" "," ",1+A$," "))):A$=0:A$=run$ *SY%=-10:A$=" "+A$:A$=A$,2):A$<>32:A$=34:A%=A$,"""",2)+1A%=A$+" "," ") 49Y%:run$=A$,1-(A$=34),A%-1+2*(A$=34)):A$=A$,A%+1) > :=A$ H!os(A$):A$=42:A$A$:A$ R \Fexit(A%):"FX1,"+(A%255):quit$=quit$:A$=quit$:quit$="":os(A$) f>&FFFFF:ȘA% p zWin_TextIO -ș"GetStdHandle",-10@hfile%(1):*INPUT 13 .ș"GetStdHandle",-11@hfile%(2):*OUTPUT 14 %ș"SetConsoleMode",@hfile%(1),0: