, > MkSrcPDP - Make a PDP-11 source file &A%=0:X%=1:os%=((&FFF4)&FF00)256 1ctrl% 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$ F0file(in$,5)<>1:"File '"in$"' not found": P9len%=X%!10:-P-2000"":out%=(out$) nA%=load%&FFFFFF00 x)A%=&FFF70000:load%=&0000:exec%=&0000 UA%=&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% AA$<>"":dat%=X%?312:wth%=(X%?33)*2+4:msk%=("&"+wth%,"F")) 0dat%=0:dat%=wth%+12dat%=12:dat%=21dat%=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%=01:addr%=load%:lbmax%=0 MB%:"Creating labels";7+wth%,".");"Scanning for labels";3+wth%,"."); 6:wth%,8);h0(addr%,wth%);:L$=line:A%=L$,"&") zA%: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$) Tout(""," ") ^Bout("","OS_CLI=&FFF7:OSBYTE=&FFF4:OSWORD=&FFF1:OSWRCH=&FFEE") hBout("","OSWRCR=&FFEC:OSNEWL=&FFE7:OSASCI=&FFE3:OSRDCH=&FFE0") rBout("","OSFILE=&FFDD:OSARGS=&FFDA:OSBGET=&FFD7:OSBPUT=&FFD4") |(out("","OSGBPB=&FFD1:OSFIND=&FFCE") out(""," ") out("","load%=&"+~load%) ,out("DIM",&DE+" mcode% &"+~(len%+20)) Atxt%: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%=0num%-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) 0Wout("PRINT",&F1+" ""*SAVE "";~mcode%;"" "";~O%;"" "";~exec%;"" "";~load%") :%out%:txt%:#out%,13:#out%,255 DAout%:#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%<0L%>43:=L$ vE((L%3-(L%>27))3-3*(L%=24)+(L%>24L%<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: Itxt%: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): 3Close_All:out%=out%:out%:A%=out%:out%=0:#A%  .ݤch(A%):A%=A%127:A%<32A%=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%=1A%=3:#?X%=X%!9 3:A%=1A%=2:#?X%,?X%!1A%=3A%=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 MA%=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=&94:="PDP11" 44ݤDis_Code(A%,Ptr%,Data%):s%,d%,c%:!X%=0:num%=2 >:c%=!Data%:s%=(c%&FC0)64:d%=c%63:c%=(c%&F000)&1000 H $(X%+4)=pdp:X%?3=num%:=num% R ݤpdp \o(c%7)=0:s%>39:s%<52:="CLRCOMINCDECNEGADCSBCTSTRORROLASRASL",3*(s%-40)+1,3)+" B",c%8+1,1)+" "+mr(d%) fm((c%-1)7)<5:="MOVCMPBITBICBIS",(c%7)*3-2,3)+" B",c%8+1,1)+" "+mr(s%)+","+mr(d%)=("FNpdp_"+~c%) p(ݤpdp_F:="FLOP "+mr(s%)+","+mr(d%) z(ݤpdp_E:="SUB "+mr(s%)+","+mr(d%) Kݤpdp_8:s%<32:="BPLBMIBHIBLSBVCBVSBCCBCS",3*((s%4))+1,3)+jr(?Data%) 9s%<40:="EMT TRAP",(s%&FC)-31,4)+" &"+h0(?Data%,2) =(s%&FC)=52:="MTPSMFPDMTPDMFPS",4*s%-207,4)+" "+mr(d%) $X%?2=128:="EQUW &"+h0(!Data%,4)  ݤpdp_7 Ds%<32:="MUL DIV ASH ASHC",4*(s%8)+1,4)+" "+mr(d%)+","+r(s%) &s%<40:="XOR "+r(s%)+","+mr(d%) ?s%=40:d%<32:="FADDFSUBFMULFDIV",4*(d%8)+1,4)+" "+r(d%) ;(s%56)=56:="SOB "+r(s%)+","+jr(d%-192*(d%>31)),3) $X%?2=128:="EQUW &"+h0(!Data%,4) (ݤpdp_6:="ADD "+mr(s%)+","+mr(d%) [ݤpdp_0:s%<32:s%>3:X%?2=(s%<8)64:="BR BNEBEQBGEBLTBGTBLE",3*(s%4)-2,3)+jr(?Data%) \s%=0:d%<7:="HALTWAITRTIBPTIOTRESETRTT",d%*4+1+(d%>2)+(d%>3)+(d%=5),4+(d%>1)-2*(d%>4)) "s%=1:X%?2=64:="JMP "+mr(d%) 's%=2:d%<8:X%?2=64:="RTS "+r(d%) &s%=2:(d%56)=24:="SPL "+(d%7) $,s%=2:(d%48)=32:="CCC &"+h0(d%&F,2) .,s%=2:(d%48)=48:="SCC &"+h0(d%&F,2) 8s%=3:="SWAB "+mr(d%) B-(s%56)=32:="JSR "+r(s%7)+","+mr(d%) Ls%=52:="MARK &"+h0(d%,2) V9(s%&FC)=52:="MFPIMTPISXT ",4*s%-211,4)+" "+mr(d%) `$X%?2=128:="EQUW &"+h0(!Data%,4) j4ݤr(A%):A%=A%7:A%=7:="PC"A%=6:="SP"="R"+A% t,ݤmr(A%):m%:m%=(A%56)8:(A%7)=7:=pc ~'m%<2:="("+r(A%)+")",2-m%,2*m%+2) :m%<6:="@",m%1)+"-",m%4)+"("+r(A%)+")"+"+",m%<4) Dnum%=num%+2:="@",m%=7)+"&"+h0(Data%!(num%-2),4)+"("+r(A%)+")" ݤpc m%<2:="(PC)",2-m%,2*m%+2) 127),4)