+ô > MkSrc816 - Make a 65816 source file &A%=0:X%=1:os%=((º&FFF4)€&FF00)256 1Şctrl% 79,name% 127:X%=ctrl%:Y%=X%256:cpu%=0 (-eol$=½(10-3*(os%<6)):ços%€32:eol$=½13+½10 2î…ö:òClose_All:ñ:à <$è†"Input object file: "in$ F0ç¤file(in$,5)<>1:ñ"File '"in$"' not found":à P9len%=X%!10:ç“-¸P-2000"":out%=®(out$) nA%=load%€&FFFFFF00 x)çA%=&FFF70000:load%=&0000:exec%=&0000 ‚UçA%=&FFFBBC00:load%=&8000:exec%=&8000:çmem%!0=0:çmem%!4=0:load%=&C000:exec%=&C000 Œ)çA%=&FFFFF800:load%=&8000:exec%=&8000 –)çA%=&FFFFFA00:load%=&0000:exec%=&0000  )çA%=&FFFFFC00:load%=&0000:exec%=&0000 ªWñ"Disassembly address: (&";~load%;:è") &"A$:çA$<>"":load%= ("&"+A$):exec%=load% ´?õ:X%!0=0:A$=¤Dis_Name(cpu%):çA$="":è"CPU number:"‰11;""cpu% ¾AıA$<>"":dat%=X%?3€12:wth%=(X%?3€3)*2+4:msk%= ("&"+Äwth%,"F")) È0çdat%=0:dat%=wth%+12‹çdat%=12:dat%=21‹dat%=9 ÒGè"(B)asic or (T)ext output? "A$:txt%=(ÀA$,1)="T"„ÀA$,1)="t") ÜGè"Output byte dump in comments? "A$:cmt%=(ÀA$,1)="Y"„ÀA$,1)="y") æGè"Output byte dump in disassembly? "A$:dmp%=(ÀA$,1)="Y"„ÀA$,1)="y") ğcmt%=cmt%„dmp% ú ãB%=0¸1:addr%=load%:lbmax%=0 MçB%:ñ"Creating labels";Ä7+wth%,".");‹ñ"Scanning for labels";Ä3+wth%,"."); 6õ:ñÄwth%,½8);¤h0(addr%,wth%);:L$=¤line:A%=§L$,"&") zçA%:çÁL$,A%+1,1)>="0":L%= ÁL$,A%):çL%>&FF:çL%>=(load%€msk%)€L%<(load%€msk%)+len%:lbmax%=lbmax%+4:çB%:!lb%=L%:lb%=lb%+4 "Faddr%=addr%+num%:ıaddr%>load%+len%:çB%=0:Şlabel% lbmax%:lb%=label% , ñ:íB% 6.ñ"Outputting source.....";¤h0(load%,wth%); @òout("REM",½&F4+" > "+out$) J'òout("REM",½&F4+" Source for "+in$) Tòout(""," ") ^Bòout("","OS_CLI=&FFF7:OSBYTE=&FFF4:OSWORD=&FFF1:OSWRCH=&FFEE") hBòout("","OSWRCR=&FFEC:OSNEWL=&FFE7:OSASCI=&FFE3:OSRDCH=&FFE0") rBòout("","OSFILE=&FFDD:OSARGS=&FFDA:OSBGET=&FFD7:OSBPUT=&FFD4") |(òout("","OSGBPB=&FFD1:OSFIND=&FFCE") †òout(""," ") òout("","load%=&"+Ã~load%) š,òout("DIM",½&DE+" mcode% &"+Ã~(len%+20)) ¤Açtxt%:òout("","FOR P=0 TO 1")‹òout("",½&E3+" P=0 "+½&B8+" 1") ®!òout("","P%=load%:O%=mcode%") ¸òout("","[OPT P*3+4") ÂUaddr%=load%:õ:ñÄwth%,½8);¤h0(addr%,wth%);:L$=¤line:çaddr%=exec%:òout("",".exec%") Ìvlb%=label%-4:õlb%=lb%+4:ılb%>label%+lbmax%„!lb%=(addr%€msk%):ç!lb%=(addr%€msk%):òout("",".L"+¤h0(addr%€msk%,wth%)) ÖyA$="":A%=§L$,"&"):çA%:çÁL$,A%+1,1)>="0":L%= ÁL$,A%):çL%>=(load%€msk%)€L%<(load%€msk%)+len%:L$=ÀL$,A%-1)+"L"+ÁL$,A%+1) à–çcmt%:A$=¤h0(addr%,wth%):B$="":ãA%=0¸num%-1:B%=?(addr%-load%+mem%+A%):A$=A$+" "+¤h0(B%,2):B$=B$+¤ch(B%):í:A$=A$+Ä(dat%-©A$)€(©A$load%+len% &,çtxt%:òout("","]NEXT")‹òout("","]"+½&ED) 0Wòout("PRINT",½&F1+" ""*SAVE "";~mcode%;"" "";~O%;"" "";~exec%;"" "";~load%") :%çout%:ç¬txt%:Õ#out%,13:Õ#out%,255 DAçout%:Ù#out%:out%=0:X%!2=&FFFFFB00-1024*txt%:A%=¤file(out$,2) Nñ:à XAݤline:num%=¤Dis_Code(cpu%,addr%,addr%-load%+mem%):L$=$(X%+4) b/num%=X%?3:flg%=X%?2:A%=§L$,"&FF"):çA%=0:=L$ l)L%= (ÁL$,A%,5))-&FFCE:çL%<0„L%>43:=L$ vEç((L%ƒ3-(L%>27))ƒ3-3*(L%=24)+(L%>24€L%<28)-3*(L%=27)-(L%=28)):=L$ €g=ÀL$,A%-1)+"OS"+Á"FINDGBPBBPUTBGETARGSFILERDCHASCINEWLWRCRWRCHWORDBYTE_CLI",(L%3)*4+1,4)+ÁL$,A%+5) Šİòout(T$,A$):çout%=0:á ”Içtxt%:A$=T$+ÁA$,(T$="")+2)+eol$:$name%=A$:ògbpb(2,out%,name%,©A$,0):á ;line%=line%+1:?name%=13:name%?1=line%256:name%?2=line% ¨=name%?3=©A$+4:$(name%+4)=A$:ògbpb(2,out%,name%,©A$+4,0):á ²3İòClose_All:out%=out%:çout%:A%=out%:out%=0:Ù#A% ¼á Æ.ݤch(A%):A%=A%€127:çA%<32„A%=127:="."‹=½A% Ğ#ݤh0(A%,N%)=Â"0000000"+Ã~A%,N%) Ú#İògbpb(A%,chn%,addr%,num%,ptr%) ä@?X%=chn%:X%!1=addr%:X%!5=num%:X%!9=ptr%:ç(os%€32)=0:Ö&FFD1:á îçA%=1„A%=3:Ï#?X%=X%!9 ø3õ:çA%=1„A%=2:Õ#?X%,?X%!1‹çA%=3„A%=4:?X%!1=š#?X% 2X%!1=X%!1+1:X%!5=X%!5-1:ı(Å#?X%€A%>2)„X%!5<1:á  Nݤfile(A$,A%):ç(os%€32)=0:$name%=A$:?X%=name%:X%?1=name%256:=(º&FFDD)€&FF MçA%=5:X%!14=(A$):çX%!14:X%!10=¢#X%!14:Ù#X%!14:X%!2=0:X%!6=0:X%!14=&33:=1  =0 */ݤDis_Name(cpu%):çcpu%=65:="65x02"‹="65816" 4:ݤDis_Code(cpu%,Ptr%,Data%):êop%,ins%,md%,b0%,num%,sz% >Qnum%=1:op%=?Data%:ins%=op%32:md%=(op%€31)4:b0%=(op%€3):sz%=2:çcpu%=65:sz%=1 H)X%!0=0:$(X%+4)=¤_diss:X%?3=num%:=num% R ݤ_diss \Tç(op%€15)=8:=Á"PHPCLCPLPSECPHACLIPLASEIDEYTYATAYCLVINYCLDINXSED",1+3*(op%16),3) f@ç(op%€&8F)=&8A:=Á"TXATXSTAXTSXDEXPHXNOPPLX",3*(op%16)-23,3) pçop%=32:="JSR"+¤mde(3) z;ç(op%€&9F)=0:X%?2=(op%€64):=Á"BRK***RTIRTS",ins%*3+1,3) „(ç(op%€&DF)=90:=Á"PHYPLY",ins%*3-5,3) çop%=&89:="BIT"+¤mde(2) ˜ çb0%=1:=¤alu(ins%)+¤mde(md%) ¢%ç(op%€31)=18:=¤alu(ins%)+¤mde(16) ¬#ç(op%€&EF)=&64:="STZ"+¤mde(md%) ¶'ç(op%€&FD)=&9C:="STZ"+¤mde(b0%*2+3) À/ç(op%€&D7)=&96:=¤rot(ins%)+¤mde(md%€3)+",Y" Ê$ç(op%€7)=6:=¤rot(ins%)+¤mde(md%) ÔKç(op%€31)=16:num%=2:="B"+Á"PLMIVCVSCCCSNEEQ",1+2*ins%,2)+¤jr(Data%?1,1) Ş=ç(op%€&8F)=10:=¤rot((ins%+(md%€4)*1.5)‚((md%>4)€1))+" A" è8ç(op%€&E7)=4:="T"+Á"SR",1+(md%4),1)+"B"+¤mde(md%€3) ò2ç(op%€&D3)=&C0:=¤bxy(ins%)+¤mde(((md%‚3)-1)€3) ü"ç(op%€&E7)=36:="BIT"+¤mde(md%) (ç(op%€&C7)=&84:=¤bxy(ins%)+¤mde(md%) 7ç(op%€&FD)=&A0:="LD"+Á"YX",1+((op%€2)2),1)+¤mde(2) 1çop%=&80:num%=2:X%?2=64:="BRA"+¤jr(Data%?1,1) $Uç(op%€&CF)=76:X%?2=64:="JMP "+À"(",op%>95)+Á¤mde(md%-4*(op%=92)),3)+À")",op%>95) .9çop%=&DC:X%?2=64:num%=3:="JMP [&"+¤h0(Data%!1,4)+"]" 8.çb0%=3:ç(md%€3)<>2:=¤alu(ins%)+¤mde(md%+8) Bkç(op%€&0F)=&0B:X%?2=((op%=&6B)€64):=Á"PHDTCSPLDTSCPHKTCDRTLTDCPHBTXYPLBTYXWAISTPXBAXCE",(op%16)*3+1,3) Lbç((op%-32)€&DF)=66:X%?2=((op%=&82)€64):num%=3:=Á"PERBRL",(op%128)*3+1,3)+¤jr(Data%!1€&FFFF,2) V\ç(op%€&DF)=&C2„op%=2:num%=2:=Á"REPSEPCOP",(ins%€1)*3+1-6*(op%=2),3)+" #&"+¤h0(Data%?1,2) `çop%=34:="JSL"+¤mde(11) j3çop%=&FC:num%=3:="JSR (&"+¤h0(Data%!1,4)+",X)" t]ç(op%€&EF)=68:num%=3:=Á"MVPMVN",(op%16)*3-11,3)+" &"+¤h0(Data%?1,2)+",&"+¤h0(Data%?2,2) ~=ç(op%€&DF)=&D4:=Á"PEIPEA",ins%*3-17,3)+¤mde((ins%€1)*2+1) ˆçop%=66:="WDM" ’!X%?2=128:="EQUB &"+¤h0(op%,2) œ3ݤalu(A%)=Á"ORAANDEORADCSTALDACMPSBC",A%*3+1,3) ¦3ݤrot(A%)=Á"ASLROLLSRRORSTXLDXDECINC",A%*3+1,3) °3ݤbxy(A%)=Á"***BIT***STZSTYLDYCPYCPX",A%*3+1,3) º ݤmde(A%) ÄNçA%=0„A%=4„A%=16:num%=2:=" (&"+¤h0(Data%?1,2)+À",X",A%=0)+")"+À",Y",A%=4) Î7çA%=1„A%=5:num%=2:=" &"+¤h0(Data%!1,2)+À",X",A%=5) Ø/çA%=2:num%=1+sz%:=" #&"+¤h0(Data%!1,sz%*2) âHçA%=3„A%=6„A%=7:num%=3:=" &"+¤h0(Data%!1,4)+À",Y",A%=6)+À",X",A%=7) ìNçA%=8„A%=12:num%=2:=" "+À"(",A%=12)+"&"+¤h0(Data%?1,2)+",S"+À"),Y",A%=12) ö>çA%=9„A%=13:num%=2:=" [&"+¤h0(Data%?1,2)+"]"+À",Y",A%=13) :çA%=11„A%=15:num%=4:=" &"+¤h0(Data%!1,6)+À",X",A%=15)  ="?" eݤjr(A%,sz%):çsz%=1:=" &"+¤h0(Ptr%+A%+2+256*(A%>127),4)‹=" &"+¤h0(Ptr%+A%+3+32768*(A%>32767),4) ÿ