Motorola dsp assembler Reference Manual



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

Expressions
Functions
MOTOROLA
DSP ASSEMBLER REFERENCE MANUAL
3-17
@MAX([,...,])
Returns the greatest of ,..., as a floating point value.  The memory
space attribute of the result will be None.
Example:
MAX
DC
@MAX(1.0,5.5,-3.25)
; MAX  =  5.5
@MIN([,...,])
Returns the least of ,..., as a floating point value.  The memory
space attribute of the result will be None.
Example:
MIN
DC
@MIN(1.0,5.5,-3.25)
; MIN  =  -3.25
@MSP()
Returns the memory space attribute of  as an integer value:
None
= 0
X space = 1
Y space = 2
L space
= 3
P space = 4
E space = 5
The may be relative or absolute.
Example:
MEM
SET
@MSP(ORIGIN)
; save memory space
@MXP()
Returns an integer 1 (memory space attribute N) if the Assembler is expanding a
macro, 0 otherwise.
Example:
IF
@MXP()
; macro expansion active?
@POS(,[,])
Returns the position of string  in  as an integer, starting at position
.  If  is not given the search begins at the beginning of .  If the


Expressions
Functions
3-18
DSP ASSEMBLER REFERENCE MANUAL
MOTOROLA
 argument is specified it must be a positive integer and cannot exceed the
length of the source string.  The memory space attribute of the result will be None.
Example:
ID
EQU
@POS('DSP96000','96')
; ID  =  3
@POW(,)
Returns  raised to the power  as a floating point value. 
and  must be separated by a comma.  The memory space attribute of the
result will be None.
Example:
BUF
EQU
@CVI(@POW(2.0,3.0))
; BUF  =  8
@REL()
Returns an integer 1 (memory space attribute N) if the Assembler is operating in
relative mode, 0 otherwise.
Example:
IF
@REL()
; in relative mode?
@RVB('>@RND()
Returns a random value in the range 0.0 to 1.0.  The memory space attribute of the
result will be None.
Example:
SEED
DC
@RND()
; save initial seed value
@RVB([,])
Reverse the bits in  delimited by the number of bits in . If 
is omitted the field is bounded by the target word size. Both expressions must be
single word integer values.
Example:
REV
EQU
@RVB(VAL)
; reverse all bits in value


Expressions
Functions
MOTOROLA
DSP ASSEMBLER REFERENCE MANUAL
3-19
@SCP(,)
Returns an integer 1 (memory space attribute N) if the two strings compare, 0 oth-
erwise.  The two strings must be separated by a comma.
Example:
IF
@SCP(STR,'MAIN')
; does STR equal MAIN?
@SGN()
Returns the sign of  as an integer:  -1 if the argument is negative, 0 if
zero, 1 if positive.  The memory space attribute of the result will be None.  The pression> may be relative or absolute.
Example:
IF
@SGN(INPUT)
; is sign positive?
@SIN()
Returns the sine of  as a floating point value.  The memory space at-
tribute of the result will be None.
Example:
DC
@SIN(@CVF(COUNT)*FREQ)
; compute sine value
@SNH()
Returns the hyperbolic sine of  as a floating point value.  The memory
space attribute of the result will be None.
Example:
HSINE
EQU
@SNH(VAL)
; hyperbolic sine
@SQT()
Returns the square root of  as a floating point value.  
must be positive.  The memory space attribute of the result will be None.
Example:
SQRT
EQU
@SQT(3.5)
; SQRT  =  1.870829


Expressions
Functions
3-20
DSP ASSEMBLER REFERENCE MANUAL
MOTOROLA
@TAN()
Returns the tangent of  as a floating point value.  The memory space
attribute of the result will be None.
Example:
MOVE
#@TAN(1.0),D1.S
; load tangent
@TNH()
Returns the hyperbolic tangent of  as a floating point value.  The
memory space attribute of the result will be None.
Example:
HTAN
=
@TNH(VAL)
; hyperbolic tangent
@UNF()
Converts  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:
FRC
EQU
@UNF($400000)
; FRC  =  0.5
@XPN()
Returns the exponential function (base e raised to the power of ) as
a floating point value.  The memory space attribute of the result will be None.
Example:
EXP
EQU
@XPN(1.0)
; EXP  =  2.718282


Yüklə 4,8 Kb.

Dostları ilə paylaş:
1   ...   13   14   15   16   17   18   19   20   ...   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ə