> Mon32 ::end: Hos%=fx(0,1):(fx(135,0)256)((<&FFFF)&80):<&FFFF:=fx(132,0) (Hio%=(fx(130,0)=&FFFF)(os%<6):ad$="ddress":dd$="isassembl":*FX219,9 2]ctrl%39,data%15,zp%3,A%-1:bln%=-A%-1500*(1-2*(>&FFFF)):buf%=-bln%:cpu:err:end: <&X%=ctrl%:Y%=X%256:P%:P%= F:hlp:menu:end: P#ݤerr:<0:P%=P%2:O%=O%2:=-1 Z:<>17: d-1:" at line "; n=-1 xend:"FX3": bot:*QUIT  nݤmenu:'30"Memory: &"ho(P%-O%,W%)19)"Origin: &"ho(O%,W%)'"Buffer: &";~buf%18)"Buffer size: &";~bln%' >addr%=line(P%):num%=addr%-P%::addr%=line(addr%):>=ht% %Q$=:Q$>"`"Q$<"{":Q$=(Q$-32) )8+9+13+127+"*+-;= ",Q$)Q$>="0" Q$=13:P%=P%+1:=0 Q$=127Q$=8:P%=P%-1:=0 Q$=" ":P%=P%+num%:=0 ,(Q$>"/"Q$<":")(Q$>"@"Q$<"G"):hex:=0 Q$="L":lst:=0 Q$="T"Q$="Y":"MessageText",1-7*(Q$="T"),7);:": "A$:A%=P%?A$:$P%=A$:P%?A$=A%:P%?(A$-1)=P%?(A$-1)((Q$="Y")&80):P%=P%+A$:=0 Q$=9:Z%=Z%64:=0 Q$="M":m:=0 Q$="O":o:=0 Q$="+"Q$=";":P%=P%+8:=0 "Q$="-"Q$="=":P%=P%-8:=0 ,Q$="*":osc:Q$="":=0 6Q$="H":Z%=Z%32:col:=0 @WQ$="G":"Load file: "A$:A$<>"":"LOAD """+A$+""" "+~buf%+"+"+~bln%,os%=32):=0 JYQ$="P":"Save file: "A$:A$<>"":"Length: &"Q$:"SAVE """+A$+""" "+~buf%+"+"+Q$:=0 T+Q$="J":Z%=(Z%-4)+((Z%3)+1)3:col:=0 ^$Q$="W":W%="44456784",W%,1):=0 hQ$="S":mde:=0 r0Q$="Z":Dis_Name(0)="":M%=Dis_CPU:cpu:=0 |Q$="R":io%:rom:=0 ?Q$="Q"Q$="X":"Quit? "Q$:A%=(Q$&DF)=89:Q$="":A%:Q$="Q"  =Q$="Q" (ݤline(addr%):ho(addr%-O%,W%);" "; Qio%:addr%<0:N%=07:data%?N%=rm(addr%+N%):N%=0154:data%!N%=addr%!N%: ^Z%64:A%=11-Z%16:N%=0A%:ho(data%?N%,2)" ";::N%=0A%:c(data%?N%);:::=addr%+A%+1 -N%=Dis_Code(M%,addr%-O%,data%)-1:A%=Z%3 0B%=0N%2^A%:ho(data%!B%,2*(2^A%));" ";: 'W%+U%);:B%=0N%:c(data%?B%);: ,W%+V%);:$(X%+4)8:(X%?264):"":O%=("&"+A$) N,"FX3":addr%=line(addr%):addr%>end%: X1hex:"Bytes: &";Q$;::A%=:A%>96:A%=A%&DF b+(A%=95A%=8)Q$<>"":127:Q$=Q$,Q$-1) l7((A%>47A%<58)(A%>64A%<71))Q$<30:A%:Q$=Q$+A% vAA%=13:Q$<>""::?P%=("&"+Q$,2)):P%=P%+1:Q$=Q$,3):Q$<2: Posc:bot::"*"A$:A$:58:Q$=(&DF):10+13+"GP",Q$):127:Q$<>10: 7rom:"ROM: &"A$:A$=uc(A$):A$="":P%=P%&FFFFFF: .P%=(P%&FFFF)&FF00000065536*("&F"+A$): mde:"Mode: "A$:A$="": &Q%=(A$)&80:io%:fx(133,Q%)<:  22,Q%: gcpu:X%=ctrl%:Y%=X%256:!X%=0:M$=Dis_Name(M%)+" D"+dd$+"er":W%=(X%?33)*2+4:Z%=(X%?3/4)31:col: /col:A%=Z%4:U%=A%*3+13:V%=U%+A%+6:A%<8: U%=17:V%=U%+7: $bot:260,ht%-8*(wd%<40)-1): =hlp:"FX3,16":26,12:wd%=fx(160,10):ht%=fx(160,9)&FF wd%>50:28,wd%-29,ht%,wd%,0:(14-M$/2);M$''"RETURN forward 1 + forward 8"'"DELETE back 1"5"- back 8"'"SPACE move past code"''" M: Set memory a"ad$'" O: Set code origin" wd%>50:" W: A"ad$" width"'" J: Data width"'" H: Hex/Oct toggle"'"TAB: Dump/list"''"0-9 A-F: Enter bytes"'" T: Enter text"'" Y: Enter message" wd%>50:" L: List d"dd$"y"'" G: Load file"'" P: Save file"'" Z: Select CPU"'" S: Screen mode"'" R: ROM number"'" Q: Quit":28,0,ht%,wd%-31,0:  \((wd%+1-M$)/2);M$:28,0,ht%,wd%,ht%-5:B$=" ":C$=" ":fx(135,0)256=7:B$=132:C$=135 B$"RETURN"C$"forward 1"5;B$"+"C$"forward 8"'B$"DELETE"C$"backward 1"4;B$"-"C$"backward 8"'B$"TAB"C$"DUMP/LIST"8;B$"H"C$"HEX/ASCII"  B$"M"C$"Set memory a"ad$" "B$"O"C$"Set code offset"8'B$"T"C$"Enter text"9;B$"Y"C$"Enter message"'B$"L"C$"List d"dd$"y "B$"SPC"C$"Move past code";:28,0,ht%-6,wd%,1:ht%=ht%-7: *2ݤho(A%,N%):Z%32:=o0(A%,N%*3/2)=h0(A%,N%) 4-ݤc(A%):A%=A%127:A%=127A%<32:="."=A% >ݤuc(A$):B$:A$="":="" H5B$=B$+(A$((A$<"@")&DF)):A$=A$,2):A$="":=B$ R#ݤh0(A%,N%)="0000000"+~A%,N%) \4ݤo0(A%,N%):A$,B%,L%:A%<0:B%=2:A%=A%&7FFFFFFF f;A$=(A%7)+A$:A%=A%8:L%=L%+3:L%>27:=(A%+B%)+A$,N%) p?ݤfx(A%,X%):Y%:Y%=X%256:<&FFFFF:=((&FFF4)&FFFF00)256 z-A%=135:X%=:X%>-1:=X%*256A%=135:=&A00 (A%=160:X%=10:=@vdu%!28@vdu%!216-1 'A%=160:X%=9:=@vdu%!36@vdu%!220-1 =((&FFF4)&FFFF00)256 7ݤrm(!&F6):Y%:Y%=?&F8+&40:Y%&40:?&F7>&BF:?&F9=0 1!&F6<0:?&F7>&7FY%=&3E:=(&FFB9)&FF=?!&F6 "ݤDis_Name(A%):X%?3=2:="32000" ;ݤDis_Code(A%,Ptr%,Data%):op%,num%,i%,g1%,g2%,op0%,dz% 7op%=!Data%:i%=op%3:g1%=Data%?18:g2%=(op%&7C0)64 ;X%!0=0:A$=_32:A$<35:$(X%+4)=A$$(X%+4)=A$,32)+"..." "num%:num%<13:X%?3=num%:=num% QX%?2=&80:X%?3=1:$(X%+4)="EQUB &"+h0(?Data%,2)+" ; num="+num%,num%<>0):=1  ݤ_32 9(op%&1F)=&06(op%&5F)=&5E(op%&EF)=&8E:num%=0:=""  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 8#(op%&FF)=&22:="CXP "+disp B,(op%&FF)=&32:X%?2=&40:="RXP "+disp L,(op%&FF)=&42:X%?2=&40:="RETT "+disp V#(op%&FF)=&52:X%?2=&40:="RETI" `%(op%&FF)=&62:="SAVE "+lst(0) j&(op%&FF)=&72:="RESTORE "+lst(7) t/(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"  num%=2 M(op%&7C)=&0C:i%<>2:="ADDQ"+sz(i%)+" "+short(g2%2)+","+gen(g1%,i%) M(op%&7C)=&1C:i%<>2:="CMPQ"+sz(i%)+" "+short(g2%2)+","+gen(g1%,i%) L(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%) Y(op%&7C)=&4C:i%<>2:="ACB"+sz(i%)+" "+short(g2%2)+","+gen(g1%,i%)+","+dispPC M(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%) 2Vnum%=3:i%=(op%&300)256:g1%=Data%?28:g2%=(op%&7C000)&4000:op0%=(Data%?1&3C)4 2:="SETCFG"+sz(Data%?13)+" "+cfg(g2%2) Fi(op%&F870FF)=&00E:i%<>2:(op%&60000)<>&40000:="MOVSCMPSxxxxSKPS",op0%*6+1,4)+sz(i%)+str(g2%2) P(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%) Zo(op%&0038FF)=&00CE:i%<>2:="MOVCMP",op0%*3+1,3)+"M"+sz(i%)+" "+gen(g1%,i%)+","+gen(g2%,i%)+","+disp d(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)) nu(op%&0020FF)=&20CE:i%<>2:="MULMEIundDEIQUOREMMODDIV",op0%*3-23,3)+sz(i%)+" "+gen(g1%,i%)+","+gen(g2%,i%) x(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%=&40A%=&C0A%=&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%) (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%?11)+" "+gen(g1%,i%)+","+gen(g2%,i%) M(op%&0078FF)=&001E:="RDVALWRVAL",op0%*5+1,5)+sz(i%)+" "+gen(g1%,i%) ](op%&0078FF)=&081E:="LMR SMR ",op0%*5-9,5)+sz(i%)+" "+mmu(g2%2)+","+gen(g1%,i%) G(op%&00001F)=&0016:="SLAVE "+((Data%?0)32)+",&"+h0(Data%!1,4) *num%=1:X%?2=&80:="equb &"+h0(op%,2) 3ݤlst(A%):rn%,n%,A$:rn%=Data%?num%:num%=num%+1 -n%=07:(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) 61ݤshort(A%):A%=A%15:A%<8:="+"+A%=(A%-16) @ݤsz(A%)="BW-D",A%+1,1) Jݤfl(A%)="LF",A%+1,1) Tݤgen(A%,sz%):rn%:rn%=A% ^A%<8:="R"+A% h&A%<16:=dispReg+"(R"+(rn%-8)+")" r,A%=16:A$=disp+"(FP)":=disp+"("+A$+")" |,A%=17:A$=disp+"(SP)":=disp+"("+A$+")" ,A%=18:A$=disp+"(SB)":=disp+"("+A$+")" A%=19:="revd" 8A%=20:sz%=0:num%=num%+1:="&"+h0(Data%?(num%-1),2) 8A%=20:sz%=1:num%=num%+2:="&"+h0(Data%!(num%-2),4) sA%=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) )A%=22:A$=disp:="EXT("+A$+")+"+disp A%=23:="TOS" A%=24:=dispReg+"(FP)" A%=25:=dispReg+"(SP)" A%=26:=dispReg+"(SB)" A%=27:=dispPC rn%=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]" 0="" :+ݤdisp:A%=dispVal:="&"+h0(A%,dz%*2+2) D&ݤdispPC:="&"+h0(Ptr%+dispOff,8) N>ݤdispReg:A%=dispOff:A%<0:=A%="&"+h0(A%,(1+~A%)-2) XkݤdispOff:A%=dispVal:dz%=("&"+"0000003F00001FFF000000001FFFFFFF",dz%*8+1,8)):A%>dz%:=A%-2*dz%-2=A% b7ݤdispVal:dz%=(Data%?num%)64:dz%="0013",dz%+1,1) l&dz%=0:num%=num%+1:=Data%?(num%-1) v>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" A%=13:="PSR" A%=14:="INTBASE" A%=15:="MOD"  ="AR"+A%  ݤmmu(A%) (A%14)=0:="BPR"+A% (A%14)=4:="PF"+(A%-4) A%=8:="SC"  A%=10:="MSR" A%=11:="BCNT"  (A%14)=12:="PTB"+(A%-12) *A%=15:="EIA" 4="mmu"+A%