*ô > MkSrc32 - Make a 320xx 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=2:="32000" 4;ݤDis_Code(A%,Ptr%,Data%):êop%,num%,i%,g1%,g2%,op0%,dz% >7op%=!Data%:i%=op%€3:g1%=Data%?18:g2%=(op%€&7C0)64 H;X%!0=0:A$=¤_32:ç©A$<35:$(X%+4)=A$‹$(X%+4)=ÀA$,32)+"..." R"çnum%:çnum%<13:X%?3=num%:=num% \QX%?2=&80:X%?3=1:$(X%+4)="EQUB &"+¤h0(?Data%,2)+À" ; num="+Ãnum%,num%<>0):=1 f ݤ_32 p9ç(op%€&1F)=&06„(op%€&5F)=&5E„(op%€&EF)=&8E:num%=0:="" z num%=1 „.ç(op%€&FF)=&EA:X%?2=&40:="BR "+¤dispPC 8ç(op%€&0F)=&0A:="B"+¤cc((op%€&F0)16)+" "+¤dispPC ˜%ç(op%€&FF)=&02:="BSR "+¤dispPC ¢,ç(op%€&FF)=&12:X%?2=&40:="RET "+¤disp ¬#ç(op%€&FF)=&22:="CXP "+¤disp ¶,ç(op%€&FF)=&32:X%?2=&40:="RXP "+¤disp À,ç(op%€&FF)=&42:X%?2=&40:="RETT "+¤disp Ê#ç(op%€&FF)=&52:X%?2=&40:="RETI" Ô%ç(op%€&FF)=&62:="SAVE "+¤lst(0) Ş&ç(op%€&FF)=&72:="RESTORE "+¤lst(7) è/ç(op%€&FF)=&82:="ENTER "+¤lst(0)+","+¤disp ò%ç(op%€&FF)=&92:="EXIT "+¤lst(7) üç(op%€&FF)=&A2:="NOP" ç(op%€&FF)=&B2:="WAIT" ç(op%€&FF)=&C2:="DIA" 4ç(op%€&FF)=&D2:num%=2:="FLAG &"+¤h0(Data%?1,2) $4ç(op%€&FF)=&E2:num%=2:="SVC &"+¤h0(Data%?1,2) . ç(op%€&FF)=&F2:num%=1:="BPT" 8 num%=2 BMç(op%€&7C)=&0C:çi%<>2:="ADDQ"+¤sz(i%)+" "+¤short(g2%2)+","+¤gen(g1%,i%) LMç(op%€&7C)=&1C:çi%<>2:="CMPQ"+¤sz(i%)+" "+¤short(g2%2)+","+¤gen(g1%,i%) VLç(op%€&7C)=&2C:çi%<>2:="SPR"+¤sz(i%)+" "+¤areg(g2%2)+","+¤gen(g1%,i%) `Mç(op%€&7C)=&3C:çi%<>2:="S"+¤cc((op%€&380)128)+¤sz(i%)+" "+¤gen(g1%,i%) jYç(op%€&7C)=&4C:çi%<>2:="ACB"+¤sz(i%)+" "+¤short(g2%2)+","+¤gen(g1%,i%)+","+¤dispPC tMç(op%€&7C)=&5C:çi%<>2:="MOVQ"+¤sz(i%)+" "+¤short(g2%2)+","+¤gen(g1%,i%) ~Lç(op%€&7C)=&6C:çi%<>2:="LPR"+¤sz(i%)+" "+¤areg(g2%2)+","+¤gen(g1%,i%) ˆç(op%€&7FC)=&27C:X%?2=&40 ’ç(op%€&FC)=&7C:çi%<>2:=ÀÁ"CXPD BICPSRJUMP BISPSRxxxx ADJSP JSR CASE",g2%4*6+1,»Á"46464534",g2%4+1,1))+¤sz(i%),5)+" "+¤gen(g1%,i%) œÇç(op%€&0C)<>&0C:çi%<>2:A%=(op%€&3C)4:A$=¤gen(g1%,i%):=ÀÁ"ADD CMP BIC xxx ADDCMOV OR xxx SUB ADDRAND xxx SUBCTBITXOR",A%*4+1,»Á"333043203430443",A%+1,1))+¤sz(i%)+" ",5)+" "+A$+","+¤gen(g2%,i%) ¦Vnum%=3:i%=(op%€&300)256:g1%=Data%?28:g2%=(op%€&7C000)&4000:op0%=(Data%?1€&3C)4 °Gç(op%€&F87CFF)=&80E:çi%<>2:="SETCFG"+¤sz(Data%?1€3)+" "+¤cfg(g2%2) ºiç(op%€&F870FF)=&00E:çi%<>2:ç(op%€&60000)<>&40000:=Á"MOVSCMPSxxxxSKPS",op0%*6+1,4)+¤sz(i%)+¤str(g2%2) ÄÍç(op%€&0000FF)=&04E:çi%<>2:=ÀÁ"ROT ASH CBIT CBITIundefLSH SBIT SBITINEG NOT undefSUBP ABS COM IBIT ADDP",op0%*5+1,»Á"3345534533543345",op0%+1,1))+¤sz(i%)+" ",5)+" "+¤gen(g1%,0)+","+¤gen(g2%,i%) Îoç(op%€&0038FF)=&00CE:çi%<>2:=Á"MOVCMP",op0%*3+1,3)+"M"+¤sz(i%)+" "+¤gen(g1%,i%)+","+¤gen(g2%,i%)+","+¤disp Ø­ç(op%€&0038FF)=&08CE:çi%<>2:A$=Á"INSEXT",op0%*3-5,3)+"S"+¤sz(i%)+" "+¤gen(g1%,i%)+","+¤gen(g2%,i%):num%=num%+1:=A$+","+Ã(Data%?(num%-1)32)+","+Ã(1+(Data%?(num%-1)€31)) âuç(op%€&0020FF)=&20CE:çi%<>2:=Á"MULMEIundDEIQUOREMMODDIV",op0%*3-23,3)+¤sz(i%)+" "+¤gen(g1%,i%)+","+¤gen(g2%,i%) ì“ç(op%€&0030FF)=&10CE:çi%<>2:=Á"MOVX"+¤sz(i%)+"WMOVZ"+¤sz(i%)+"WMOVZ"+¤sz(i%)+"DMOVX"+¤sz(i%)+"D",op0%*6-23,6)+" "+¤gen(g1%,i%)+","+¤gen(g2%,i%) ö„ç(op%€&00047F)=&002E:çi%<>2:=Á"EXTINS",(op%€&80)128*3+1,3)+¤sz(i%)+" R"+Ã(op0%2)+","+¤gen(g1%,i%)+","+¤gen(g2%,i%)+","+¤disp ¿ç(op%€&00003F)=&002E:çi%<>2:A%=(op%€&C0)+(op%€&400)4:çA%=&40„A%=&C0„A%=&100:=ÀÁ"CVTP xxxxxCHECKINDEX",A%64*5-4,5+(A%=64))+¤sz(i%)+" ",6)+" R"+Ã(op0%2)+","+¤gen(g1%,i%)+","+¤gen(g2%,i%)  Rç(op%€&0004FF)=&046E:çi%<>2:="FFS"+¤sz(i%)+" "+¤gen(g1%,i%)+","+¤gen(g2%,i%) iç(op%€&002CFF)=&0CAE:çi%<>2:="MOV"+Á"SUUS",(op0%€4)2+1,2)+¤sz(i%)+" "+¤gen(g1%,i%)+","+¤gen(g2%,i%) 0ç(op%€&003FFF)=&083E:="LFSR "+¤gen(g1%,i%) (0ç(op%€&003FFF)=&303E:="SFSR "+¤gen(g1%,i%) 2«ç(op%€&0000FF)=&003E:çi%<>2:=Á"MOV xxxxxMOVLFMOVFLROUNDTRUNCxxxxxFLOOR",(op0%2)*5+1,»Á"35555555",(op0%2)+1,1))+¤fl(op%€1)+¤sz(i%)+" "+¤gen(g1%,i%)+","+¤gen(g2%,i%) <Œç(op%€&0002FF)=&00BE:=Á"ADDMOVCMPxxxSUBNEGundundDIVxxxundundMULABSundund",op0%*3+1,3)+¤fl(Data%?1€1)+" "+¤gen(g1%,i%)+","+¤gen(g2%,i%) FMç(op%€&0078FF)=&001E:=Á"RDVALWRVAL",op0%*5+1,5)+¤sz(i%)+" "+¤gen(g1%,i%) P]ç(op%€&0078FF)=&081E:=Á"LMR SMR ",op0%*5-9,5)+¤sz(i%)+" "+¤mmu(g2%2)+","+¤gen(g1%,i%) ZGç(op%€&00001F)=&0016:="SLAVE "+Ã((Data%?0)32)+",&"+¤h0(Data%!1,4) d*num%=1:X%?2=&80:="equb &"+¤h0(op%,2) n3ݤlst(A%):êrn%,n%,A$:rn%=Data%?num%:num%=num%+1 x-ãn%=0¸7:ç(rn%€(2^n%)):A$=A$+",R"+Ã(n%‚A%) ‚ín%:="["+ÁA$,2)+"]" ŒIݤcfg(A%)=À"I",(A%€1)=1)+À"F",(A%€2)=2)+À"M",(A%€4)=4)+À"C",(A%€8)=8) –Lݤstr(A%)=À"T",(A%€1)=1)+À"B",(A%€2)=2)+À"W",(A%€12)=4)+À"U",(A%€12)=12)  :ݤcc(A%)=Á"EQNECSCCHILSGTLEFSFCLOHSLTGEALNV",A%*2+1,2) ª1ݤshort(A%):A%=A%€15:çA%<8:="+"+ÃA%‹=Ã(A%-16) ´ݤsz(A%)=Á"BW-D",A%+1,1) ¾ݤfl(A%)=Á"LF",A%+1,1) Èݤgen(A%,sz%):êrn%:rn%=A% ÒçA%<8:="R"+ÃA% Ü&çA%<16:=¤dispReg+"(R"+Ã(rn%-8)+")" æ,çA%=16:A$=¤disp+"(FP)":=¤disp+"("+A$+")" ğ,çA%=17:A$=¤disp+"(SP)":=¤disp+"("+A$+")" ú,çA%=18:A$=¤disp+"(SB)":=¤disp+"("+A$+")" çA%=19:="revd" 8çA%=20:çsz%=0:num%=num%+1:="&"+¤h0(Data%?(num%-1),2) 8çA%=20:çsz%=1:num%=num%+2:="&"+¤h0(Data%!(num%-2),4) "sçA%=20:num%=num%+4:="&"+¤h0(Data%?(num%-4),2)+¤h0(Data%?(num%-3),2)+¤h0(Data%?(num%-2),2)+¤h0(Data%?(num%-1),2) , çA%=21:="@&"+¤h0(¤dispOff,8) 6)çA%=22:A$=¤disp:="EXT("+A$+")+"+¤disp @çA%=23:="TOS" JçA%=24:=¤dispReg+"(FP)" TçA%=25:=¤dispReg+"(SP)" ^çA%=26:=¤dispReg+"(SB)" hçA%=27:=¤dispPC rrn%=Data%?num%:num%=num%+1 |/çA%=28:=¤gen(rn%8,sz%)+"[R"+Ã(rn%€7)+":B]" †/çA%=29:=¤gen(rn%8,sz%)+"[R"+Ã(rn%€7)+":W]" /çA%=30:=¤gen(rn%8,sz%)+"[R"+Ã(rn%€7)+":D]" š/çA%=31:=¤gen(rn%8,sz%)+"[R"+Ã(rn%€7)+":Q]" ¤="" ®+ݤdisp:A%=¤dispVal:="&"+¤h0(A%,dz%*2+2) ¸&ݤdispPC:="&"+¤h0(Ptr%+¤dispOff,8) Â>ݤdispReg:A%=¤dispOff:çA%<0:=ÃA%‹="&"+¤h0(A%,(1+©Ã~A%)€-2) ÌkݤdispOff:A%=¤dispVal:dz%= ("&"+Á"0000003F00001FFF000000001FFFFFFF",dz%*8+1,8)):çA%>dz%:=A%-2*dz%-2‹=A% Ö7ݤdispVal:dz%=(Data%?num%)64:dz%=»Á"0013",dz%+1,1) à&çdz%=0:num%=num%+1:=Data%?(num%-1) ê>çdz%=1:num%=num%+2:=Data%?(num%-1)+256*(Data%?(num%-2)€63) ôdnum%=num%+4:=Data%?(num%-1)+256*Data%?(num%-2)+65536*Data%?(num%-3)+&1000000*(Data%?(num%-4)€63) şݤareg(A%) çA%=0:="US" çA%=8:="FP" çA%=9:="SP" &çA%=10:="SB" 0çA%=13:="PSR" :çA%=14:="INTBASE" DçA%=15:="MOD" N ="AR"+ÃA% X ݤmmu(A%) bç(A%€14)=0:="BPR"+ÃA% lç(A%€14)=4:="PF"+Ã(A%-4) vçA%=8:="SC" €çA%=10:="MSR" ŠçA%=11:="BCNT" ”ç(A%€14)=12:="PTB"+Ã(A%-12) çA%=15:="EIA" ¨="mmu"+ÃA% ÿ