)ô > MkSrc09 - Make a 6809 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(A%):X%?3=0:="6809" 4$ݤDis_Code(A%,Ptr%,Data%):num%=1 >GX%!0=0:$(X%+4)=¤_diss:çnum%<1:num%=1:$(X%+4)="EQUB &"+¤h0(?Data%,2) HX%?3=num%:=num% Rݤ_diss:op%=?Data%:num%=1 \/ç(op%€&CF)=&83:="SUBD "+¤mde2((op%€&30)16) f/ç(op%€&CF)=&C3:="ADDD "+¤mde2((op%€&30)16) pçop%=&87:num%=0:="" zçop%=&C7:num%=0:="" „Bç(op%€&CF)=&87:="ST"+½(65+(op%€64)64)+" "+¤mde((op%€&30)16) /ç(op%€&CF)=&8C:="CMPX "+¤mde2((op%€&30)16) ˜/ç(op%€&CF)=&CC:="LDD "+¤mde2((op%€&30)16) ¢1çop%=&8D:num%=2:="BSR &"+¤h0(¤jr(Data%?1),4) ¬.ç(op%€&CF)=&8D:="JSR "+¤mde((op%€&30)16) ¶çop%=&CD:num%=0:="" À/ç(op%€&CF)=&CD:="STD "+¤mde2((op%€&30)16) Ê/ç(op%€&CF)=&8E:="LDX "+¤mde2((op%€&30)16) Ô/ç(op%€&CF)=&CE:="LDU "+¤mde2((op%€&30)16) Şçop%=&8F:num%=0:="" è/ç(op%€&CF)=&8F:="STX "+¤mde2((op%€&30)16) òçop%=&CF:num%=0:="" ü/ç(op%€&CF)=&CF:="STU "+¤mde2((op%€&30)16) ]ç(op%€&80)=&80:=¤alu(op%€15)+½(65+(op%€64)64)+" "+À" ",(op%€&8E)=&86)+¤mde((op%€&30)16) 2ç(op%€&E0)=&40:=¤rot(op%€15)+½(65+(op%€16)16) /ç(op%€&EF)=&6E:="JMP "+¤mde2((op%€&30)16) $8ç(op%€&E0)=&60:=¤rot(op%€15)+" "+¤mde((op%€&30)16) .qç(op%€&F0)=&20:num%=num%+1:="B"+Á"RARNHILSCCCSNEEQVCVSPLMIGELTGTLE",(op%€15)*2+1,2)+" &"+¤h0(¤jr(Data%?1),4) 8çop%=&0E:="JMP "+¤mde(1) B-ç(op%€&F0)=&00:=¤rot(op%€15)+" "+¤mde(1) Lçop%=&10:=¤grp10 Vçop%=&11:=¤grp11 `çop%=&12:="NOP" jçop%=&13:="SYNC" tçop%=&19:="DAA" ~çop%=&1A:="ORCC "+¤mde(0) ˆçop%=&1C:="ANDCC "+¤mde(0) ’çop%=&1D:="SEX" œ_ç(op%€&FE)=&1E:num%=num%+1:=Á"EXGTFR",(op%€1)*3+1,3)+" "+¤r(Data%?116)+","+¤r(Data%?1€15) ¦2ç(op%€&FC)=&30:="LEA"+¤reg2(op%€3)+" "+¤mde(2) °/çop%=&34:num%=num%+1:="PSHS "+¤stk(Data%?1) º/çop%=&35:num%=num%+1:="PULS "+¤stk(Data%?1) Ä/çop%=&36:num%=num%+1:="PSHU "+¤stk(Data%?1) Î/çop%=&37:num%=num%+1:="PULU "+¤stk(Data%?1) Øçop%=&39:="RTS" âçop%=&3A:="ABX" ìçop%=&3B:="RTI" öçop%=&3C:="CWAI" çop%=&3D:="MUL"  çop%=&3F:="SWI" >çop%=&16:num%=3:="LBRA &"+¤h0(¤ljr(256*Data%?1+Data%?2),4) >çop%=&17:num%=3:="LBSR &"+¤h0(¤ljr(256*Data%?1+Data%?2),4) (çop%=&3E:="RESET" 2num%=0:="" <#ݤgrp10:num%=num%+1:op%=Data%?1 F~ç(op%€&E0)=&20:num%=num%+1:="LB"+Á"RARNHILSCCCSNEEQVCVSPLMIGELTGTLE",(op%€15)*2+1,2)+" &"+¤h0(¤ljr(256*Data%?1+Data%?2),4) Pçop%=&3F:="SWI2" Z/ç(op%€&CF)=&83:="CMPD "+¤mde2((op%€&30)16) d/ç(op%€&CF)=&8C:="CMPY "+¤mde2((op%€&30)16) n/ç(op%€&CF)=&8E:="LDY "+¤mde2((op%€&30)16) xçop%=&8F;num%=0:="" ‚/ç(op%€&CF)=&8F:="STY "+¤mde2((op%€&30)16) Œ/ç(op%€&CF)=&CE:="LDS "+¤mde2((op%€&30)16) –çop%=&CF:num%=0:=""  /ç(op%€&CF)=&CF:="STS "+¤mde2((op%€&30)16) ªnum%=0:="" ´#ݤgrp11:num%=num%+1:op%=Data%?1 ¾çop%=&3F:="SWI3" È/ç(op%€&CF)=&83:="CMPU "+¤mde2((op%€&30)16) Ò/ç(op%€&CF)=&8C:="CMPS "+¤mde2((op%€&30)16) Ünum%=0:="" æQݤalu(A%)=Á"SUBCMPSBCxxxANDBITLD ST EORADCOR ADD",A%*3+1,3+(A%=6„A%=7„A%=10)) ğ5ݤrot(A%):çA%=1„A%=2„A%=5„A%=11„A%=14:num%=-9:="" úB=Á"NEGxxxxxxCOMLSRxxxRORASRASLROLDECxxxINCTSTxxxCLR",A%*3+1,3) Rݤmde2(A%):çA%=0:num%=num%+2:="#&"+¤h0(Data%?(num%-2),2)+¤h0(Data%?(num%-1),2) ;ݤmde(A%):çA%=0:num%=num%+1:="#&"+¤h0(Data%?(num%-1),2) 0çA%=1:num%=num%+1:="&"+¤h0(Data%?(num%-1),2) "+çA%=2:num%=num%+1:=¤idx(Data%?(num%-1)) ,FçA%=3:num%=num%+2:="&"+¤h0(Data%?(num%-2),2)+¤h0(Data%?(num%-1),2) 6-ݤidx(A%):R$=¤reg1((A%€&60)32):A%=A%€&9F @çA%<16:=Ã(A%€15)+","+R$ J çA%<32:=Ã((A%€15)-16)+","+R$ T&O$="":C$="":ç(A%€16):O$="[":C$="]" ^ A%=A%€15 hçA%=0:çO$<>"":num%=0:="" rçA%=0:=O$+R$+"+,"+C$ |çA%=1:=O$+R$+"++,"+C$ †çA%=2:çO$<>"":num%=0:="" çA%=2:=O$+",-"+R$+C$ šçA%=3:=O$+",--"+R$+C$ ¤çA%=4:=O$+","+R$+C$ ®çA%=5:=O$+"B,"+R$+C$ ¸çA%=6:=O$+"A,"+R$+C$ ÂçA%=7:num%=0:"" Ì=çA%=8:num%=num%+1:=O$+"&"+¤h0(Data%?(num%-1),2)+","+R$+C$ ÖSçA%=9:num%=num%+2:=O$+"&"+¤h0(Data%?(num%-2),2)+¤h0(Data%?(num%-1),2)+","+R$+C$ àçA%=10:num%=0:="" êçA%=11:=O$+"D,"+R$+C$ ô=çA%=12:num%=num%+1:=O$+"&"+¤h0(Data%?(num%-1),2)+",PC"+C$ şSçA%=13:num%=num%+2:=O$+"&"+¤h0(Data%?(num%-2),2)+¤h0(Data%?(num%-1),2)+",PC"+C$ çA%=14:num%=0:="" çA%=14:çO$="":num%=0:="" MçA%=15:num%=num%+2:=O$+"&"+¤h0(Data%?(num%-2),2)+¤h0(Data%?(num%-1),2)+C$ &="" 0ݤreg1(A%)=Á"XYUS",A%+1,1) :ݤreg2(A%)=Á"XYSU",A%+1,1) DEݤr(A%)=Á"D X Y U S PC????A B CCDP????????",A%*2+1,1-(A%=5„A%>9)) N$ݤjr(A%):=Ptr%+2+A%+256*(A%>127) X)ݤljr(A%):=Ptr%+3+A%+65536*(A%>32767) bݤstk(A%):A$="" lç(A%€1):A$=",CC" vç(A%€2):A$=A$+",A" €ç(A%€4):A$=A$+",B" Šç(A%€8):A$=A$+",DP" ”ç(A%€16):A$=A$+",X" ç(A%€32):A$=A$+",Y" ¨*ç(A%€64):A$=A$+Á",U,S",(?Data%€2)+1,2) ²ç(A%€128):A$=A$+",PC" ¼ =ÁA$,2) ÿ