>FPAssemble version 1.01R  > ; >Program Copyright Stewart Brodie - 7 February 1991 (: 2E This software may be freely distributed provided that the above 9 reg2<16 F$=F$,2):reg=reg2  3 reg>max_register &A0001,"Bad register"+E$ @ Q$="F" max_register=15 &A0007,"Need ARM register"+E$ ? Q$="R" max_register=7 &A0008,"Need FP register"+E$  F$=F$,2) =reg & 0 _FP_upper_case(F$) : G$,G% D G%=1 F$ N# F$,G%)>96 F$,G%)<123 X G$+=(F$,G%)-32) b l G$+=(F$,G%)) v  =G$    _get_FP_constant(F$)  reg  reg=F$  Ȏ reg  0.0:=0  1.0:=1  2.0:=2  3.0:=3  4.0:=4  5.0:=5   0.5:=6  10.0:=7    ** &A0005,"Bad immediate constant"+E$ 4 >=0 H R _FP_strip_spaces( I$) \ȕ I$=32:I$=I$,2): f p z _list_FP_commands  I$,I% ' "Floating point instruction set:"   +0  I$,I% ȕ I$<>"END"  I$  I$,I%    H This routine provides the decoding for Floating Point instructions   _FP(instr$) I I%,I$,X,Y,P$,cond%,roundX,roundY,round%,prec%,Fd,Rn,Fm,Fn,Rm,const% 6 E$,index,wb,offset,sign,K$,Rd,binop,instruction% $"instr$=_FP_upper_case(instr$) .#E$=" in "+instr$+" instruction" 8I%=0 B L +0 V `' LDF,%1100000100000000000100000000 j' STF,%1100000000000000000100000000 t ADF,0 ~ MUF,2  SUF,4  RSF,6  DVF,8  RDF,10  POW,12  RPW,14  RMF,16  FML,18  FDV,20  FRD,22  POL,24  MVF,1  MNF,3  ABS,5  RND,7  SQT,9 ( LOG,11 2 LGN,13 < EXP,15 F SIN,17 P COS,19 Z TAN,21 d ASN,23 n ACS,25 x ATN,27  FLT,0  FIX,1  WFS,2  RFS,3  WFC,4  RFC,5  CMFE,6  CNFE,7  CMF,4  CNF,5  END,0   I$,opcode% instruction%=0  ȕ I$<>"END" "; (instr$,5)="CMFEQ" instr$,5)="CNFEQ") I$=4 , I$="NotCompare" 6 @ instr$,I$)=I$ J J$=I$ T I$=instr$,1+I$) ^9 cond%="EQNECSCCMIPLVSVCHILSGELTGTLEALNV",I$,2)) h cond%=0 cond%2=0 r cond%=&E |  cond%=cond%2  I$=I$,3)  L cond%=cond%<<28 : Stick the condition code in the right place   Ȏ J$ $ "WFS","RFS","WFC","RFC":  X=0:Y=0  roundX=0  roundY=0  :  P$=I$,1)  Ȏ P$  "S":X=0:Y=0 = "D":X=1:Y=0 : Evaluate precision  "E":X=0:Y=1 & "P":X=1:Y=1 0  : X=0 D Y=0 N0 ERROR &A0000,"Missing precision"+E$ X b l I$=I$,2) v Ȏ J$  "LDF","STF": ? round%=0 : Now evaluate rounding mode  roundX=0  roundY=0    P$=I$,1)  Ȏ P$ ' "P":roundX=1:roundY=0 ' "M":roundX=1:roundY=0 ' "Z":roundX=1:roundY=1  :  roundX=0  roundY=0  I$=" "+I$    I$=I$,2)  * 4 > H _FP_strip_spaces(I$) R \ f" round%=roundX*64+roundY*32 p prec%=(1<<19)*Y+128*X z  Ȏ J$  "LDF","STF":  index=1<<24  wb=0 ! prec%=(Y<<22)+(X<<15) , Fd=(_get_FP_register(I$,7))<<12 ! _FP_strip_spaces(I$) 7 I$,2)<>",[" &A0002,"Syntax error"+E$  I$=I$,3) - Rn=(_get_FP_register(I$,15))<<16 ! _FP_strip_spaces(I$)  I$,1)="]"  I$=I$,2) # _FP_strip_spaces(I$)  wb=1<<21  index=0 $ I$=0 . offset=0 8 sign=0 B index=0 L& : Used to be an ELSE V ` K$=I$,1+I$,"]")) j# _FP_strip_spaces(K$) t% K$,1)="!" wb=1<<21 ~ I$=I$,I$,"]")-1)  I$,2)=",#"  I$=I$,3)  ( &A0003,"Syntax error"+E$  offset=(I$) 4 (offset)=-1 sign=1:offset=(offset) @ (offset)4<>0 &A0004,"Not on a word boundary"+E$  offset=offset 4 ? offset>255 &A0005,"Bad immediate constant"+E$  sign=(1-sign)<<23 h instruction%=cond% round% prec% index wb Fd Rn offset sign index opcode%  "FLT": 4 Fn=((_get_FP_register(I$,7))<<16) 272  I$=I$,2) (- Rd=(_get_FP_register(I$,15))<<12 2' opcode%=(opcode% 224)<<20 instruction%=cond% opcode% Rd prec% round% & "CMF","CNF","CMFE","CNFE": G opcode%=((opcode%*2+1)<<20) (&F1<<8) 16 cond% prec%  I$,1)="#"  I$=I$,2) * Fm=8 _get_FP_constant(I$) I$=I$,1+I$,","))  ( Fm=_get_FP_register(I$,7)  I$=I$,2)   I$,1)="#" A (Fm 8) &A0008,"Can't have two constants"+E$ " Fn=Fm<<16 , I$=I$,2) 6* Fm=_get_FP_constant(I$) 8 @ J. Fn=(_get_FP_register(I$,7))<<16 T ^N instruction%=round% Fn Fm opcode% (&E<<24) cond% prec% h  r binop=(opcode%2)=0 |G opcode%=(((opcode%2)+&E0)<<20) ((opcode%2)<<15) cond% , Fd=(_get_FP_register(I$,7))<<12  I$=I$,2)  binop . Fn=(_get_FP_register(I$,7))<<16  I$=I$,2)   Fn=0  I$,1)="#"  I$=I$,2) * Fm=8 _get_FP_constant(I$)  ( Fm=_get_FP_register(I$,7)  F instruction%=opcode% Fm Fn Fd prec% round% 256  & 0 instruction%<>0 +0 : I$,opcode% D N X END,0 b l6 instruction%=0 &A0006,"Unknown FP opcode"+E$ v =instruction%