1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
|
fpc MACRO val:REQ ; this is BitRAKE's fpc macro
LOCAL w,x,y,z,zz,ww
;; split type and value, defaulting to REAL4
z INSTR 1,<&val>,<! >
IF z EQ 0
y TEXTEQU <REAL4>
x TEXTEQU <&val>
ELSE
y TEXTEQU @SubStr(<&val>,1,z-1) ;; Type
x TEXTEQU @SubStr(<&val>,z+1,) ;; Value
ENDIF
;; replace . with _
z INSTR 1,x,<!.>
IF z EQ 0
w TEXTEQU x
x CATSTR x,<.0> ;; prevent error message
ELSE
w CATSTR @SubStr(%x,1,z-1),<_>,@SubStr(%x,z+1,)
ENDIF
;; replace - with _
zz INSTR 1,w,<!->
IF zz EQ 0
ww TEXTEQU w
ELSE
ww CATSTR @SubStr(%w,1,zz-1),<_>,@SubStr(%w,zz+1,)
ENDIF
;; figure out global name for constant
z SIZESTR y ;; use last char for size distiction
ww CATSTR <__>,ww,<r>,@SubStr(%y,z,1)
IF (OPATTR(ww)) EQ 0 ;; not defined
CONST$fpu SEGMENT
ww y x
CONST$fpu ENDS
ENDIF
EXITM ww
ENDM |
Partager