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

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
In this example, the first line inside of the
word of main memory from the address of
640. Further down, in the
from the address of
has
reads the next word, effectively @
Note that if the data was not word-aligned, either intentionally or coincidentally, we’d have
different results from the
shifted forward by one byte, the first value read by the loop would be $99xx; where xx is an
unknown byte-sized value. Similarly, the second value read would be 59647; made up of the
$FF from the upper byte of
second value. Make sure to pay close attention to data value alignments in memory to avoid
this likely unintentional result.
Using a similar syntax, words of main memory can be written to as well, as long as they are
RAM locations. For example:
This line writes the value 8,192 to the first word of data at
Accessing Words of Long-Sized Variables (Syntax 4)
In
long-sized variables. For example:
VAR
PUB Main
This example accesses the word-sized components of
indicate what each line is doing. At the end of the
Page 334 · Propeller Manual v1.0
WORD[@MyList][0] := 8_192
long LongVar
LongVar.word := 65000
LongVar.word[0] := 65000
LongVar.word[1] := 1
PUB
Index
and
– Spin Language Reference
set to 0, the first word of
PRI
blocks, syntax 4 of
MyList
REPEAT
REPEAT
+
MyList
Index
loop just described. For example, if
MyList
’s first value, and the 232 from the lower byte of
loop, the
MyList
WORD
and stores it in
'Set first word of LongVar to 65000
'Same as above
'Set second word of LongVar to 1
is used to read or write word-sized components of
+
GetData
MyData
is read, $FF99. The next time through the loop it
1
'Write 8,192 to first word of MyList
WORD
(the 1,000).
Main
declaration reads a word of main memory
and stores it in
method uses the
Temp
LongVar
method
. Since the first iteration of the loop
MyList
, individually. The comments
LongVar
.
Temp
WORD
MyList
, in this case, the value
will equal 130,536.
declaration to read a
happened to be
MyList
’s

Related parts for 122-32000