122-32000 Parallax Inc, 122-32000 Datasheet - Page 278

MANUAL PROPELLER

122-32000

Manufacturer Part Number
122-32000
Description
MANUAL PROPELLER
Manufacturer
Parallax Inc
Datasheets

Specifications of 122-32000

Accessory Type
Manual
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
For Use With/related Products
Propeller Education (PE) Kit
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
Operators – Spin Language Reference
X := Y => Z
The above example compares the value of
with the value of
and sets
to either:
(-1)
Y
Z
X
TRUE
if
is equal to or greater than the value of
, or
(0) if
is less than the value of
.
Y
Z
FALSE
Y
Z
This operator is often used in conditional expressions, such as in the following example.
IF (Y => 100)
Here, the Is Equal or Greater operator returns
if
is equal to or greater than 100.
TRUE
Y
Is Equal or Greater has an assignment form,
, that uses the variable to its left as both the
=>=
first operand and the result destination. For example,
X =>= Y
'Short form of X := X => Y
Here,
is compared with
, and if
is equal to or greater than
,
is set to
(-1),
X
Y
X
Y
X
TRUE
otherwise
is set to
(0). The assignment form of Is Equal or Greater may also be used
X
FALSE
within expressions for intermediate results; see Intermediate Assignments, page 253.
Symbol Address ‘
@
The Symbol Address operator returns the address of the symbol following it. Symbol
Address can be used in variable and integer constant expressions, but not in floating-point
constant expressions. Example:
BYTE[@Str] := "A"
In the above example, the Symbol Address operator returns the address of the
symbol,
Str
which is then used by the
memory array reference to store the character
at that
BYTE
"A"
address.
Symbol Address is often used to pass the address of strings and data structures, defined in a
block, to methods that operate on them.
DAT
It is important to note that this is a special operator that behaves differently in variable
expressions than it does in constant expressions. At run time, like our example above shows,
it returns the absolute address of the symbol following it. This run-time, absolute address
consists of the object’s program base address plus the symbol’s offset address.
In constant expressions, it only returns the symbol’s offset within the object. It can not return
the absolute address, effective at run time, because that address changes depending on the
object’s actual address at run time. To properly use the Symbol Address in a constant, such
as a table of data, see the Object Address Plus Symbol operator, below.
Page 278 · Propeller Manual v1.0

Related parts for 122-32000