Motorola dsp assembler Reference Manual



Yüklə 4,8 Kb.
Pdf görüntüsü
səhifə16/91
tarix08.10.2017
ölçüsü4,8 Kb.
#3546
1   ...   12   13   14   15   16   17   18   19   ...   91

Expressions
Functions
3-14
DSP ASSEMBLER REFERENCE MANUAL
MOTOROLA
@FLD(,,[,])
Shift and mask  into  for  bits beginning at bit .  If
 is omitted, zero (least significant bit) is assumed.  All arguments must be
positive integers and none may be greater than the target word size.  Returns the
shifted and masked value with a memory space attribute of None.
Example:
SWITCH
EQU
@FLD(TOG,1,1,7)
; turn eighth bit on
@FLR()
Returns a floating point value which represents the largest integer less than or
equal to .  The memory space attribute of the result will be None.
Example:
FLOOR
SET
@FLR(2.5)
; FLOOR  =  2.0
@FRC()
For binary fractional DSPs (DSP56000) this functions performs scaling and con-
vergent rounding to obtain the fractional representation of the floating point pression> as an integer.  For floating point DSPs (DSP96000) this function simply
returns the binary representation of  as an integer.  The memory
space attribute of the result will be None.
Example:
FRAC
EQU
@FRC(FLT)+1
; compute saturation
@INT()
Returns an integer 1 (memory space attribute N) if  has an integer re-
sult, 0 otherwise.  The  may be relative or absolute.
Example:
IF
@INT(TERM)
; insure integer value
@L10()
Returns the base 10 logarithm of  as a floating point value.  sion> must be greater than zero.  The memory space attribute of the result will be
None.
Example:
LOG
EQU
@L10(100.0)
; LOG  =  2


Expressions
Functions
MOTOROLA
DSP ASSEMBLER REFERENCE MANUAL
3-15
@LCV({R}[,{L | H | }])
If L is specified as the first argument, returns the memory space attribute and value
of the load location counter.  If R is specified, returns the memory space attribute
and value of the runtime location counter.  The optional second argument indicates
the Low, High, or numbered counter and must be separated from the first argument
by a comma.  If no second argument is present the default counter (counter 0) is
assumed.
The @LCV function will not work correctly if used to specify the runtime counter
value of a relocatable overlay. This is because the resulting value is an overlay ex-
pression, and overlay expressions may not be used to set the runtime counter for
a subsequent overlay. See the ORG directive (Chapter 6) for more information.
Also, @LCV(L,...) will not work inside a relocatable overlay. In order to obtain the
load counter value for an overlay block, origin to the load space and counter imme-
diately before the overlay and use @LCV(L) to get the beginning load counter val-
ue for the overlay.
Example:
ADDR
=
@LCV(R)
; save runtime address
@LEN()
Returns the length of  as an integer.  The memory space attribute of the
result will be None.
Example:
SLEN
SET
@LEN('string')
; SLEN  =  6
@LFR()
For binary fractional DSPs (DSP56000) this functions performs scaling and con-
vergent rounding to obtain the fractional representation of the floating point pression> as a long integer.  For floating point DSPs (DSP96000) this function
simply returns the binary representation of  as a long integer.  The
memory space attribute of the result will be None.
Example:
LFRAC
EQU
@LFR(LFLT)
; store binary form


Expressions
Functions
3-16
DSP ASSEMBLER REFERENCE MANUAL
MOTOROLA
@LNG(,)
Concatenates the single word  and  into a double word value such
that  is the high word and  is the low word.  The memory space
attribute of the result will be None.
Example:
LWORD
DC
@LNG(HI,LO)
; build long word
@LOG()
Returns the natural logarithm of  as a floating point value.  sion> must be greater than zero.  The memory space attribute of the result will be
None.
Example:
LOG
EQU
@LOG(100.0)
; LOG  =  4.605170
@LST()
Returns the value of the LIST directive flag as an integer, with a memory space at-
tribute of None.  Whenever a LIST directive is encountered in the Assembler
source, the flag is incremented; when a NOLIST directive is encountered, the flag
is decremented.
Example:
DUP
@CVI(@ABS(@LST()))
; list unconditionally
@LUN()
Converts the double-word  to a floating point value.  For fractional
DSPs (DSP56000)  should represent a binary fraction.  For floating
point DSPs (DSP96000)  should represent a binary floating point
number.  The memory space attribute of the result will be None.
Example:
DBLFRC
EQU
@LUN($3FE0000000000000)
;DBLFRC  =  0.5
@MAC()
Returns an integer 1 (memory space attribute N) if  has been defined as
a macro name, 0 otherwise.
Example:
IF
@MAC(DOMUL)
; expand macro


Yüklə 4,8 Kb.

Dostları ilə paylaş:
1   ...   12   13   14   15   16   17   18   19   ...   91




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©genderi.org 2024
rəhbərliyinə müraciət

    Ana səhifə