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

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
Reading/Writing Longs of Main Memory (Syntax 3)
In
memory. In the following two examples, we’ll assume our object contained the
from the example above, and we will demonstrate two different ways to access that data.
First, let’s try accessing the data directly using the labels we provided in our data block.
PUB GetData | Index, Temp
The first line inside of the
MyData
loop, the
MyList + Index
byte 0) is read from
read, $55 ($FF995544’s byte 1). Why were bytes read instead of longs?
start of our desired data and our data was specified as long-sized data but the symbol
is treated as a byte pointer since that data was specified to be byte-aligned.
Perhaps you intended to read long-sized data from
Coincidentally, even though
to be long-aligned as well because the previous declaration finished on a long boundary. This
fact allows us to use the
PUB GetData | Index, Temp
In this example, the first line inside of the
long of main memory from the address of
640,000. Further down, in the
memory from the address of
Page 238 · Propeller Manual v1.0
Temp := MyData
<do something with Temp>
repeat Index from 0 to 1
Temp := LONG[@MyData]
<do something with Temp>
repeat Index from 0 to 1
PUB
Temp := MyList[Index]
<do something with Temp>
Temp := LONG[@MyList][Index] 'Read data to Temp 1 long at a time
<do something with Temp>
and
list (the long-sized value 640,000) and stores it in
– Spin Language Reference
Temp := MyList[Index]
PRI
blocks, syntax 3 of
. The first time through the loop (
MyList
LONG
and the second time through the loop (
GetData
MyList
MyList
declaration to achieve our goal.
REPEAT
line reads a byte of main memory from the location of
LONG
+
is declared as byte-aligned long data, it is also happens
method,
Index
is used to read or write long-sized values of main
GetData
loop, the
MyData
'Read first long of MyData into Temp
'Perform task with Temp
'Repeat two times
'Read data into Temp 1 long at a time
'Perform task with value in Temp
'Read first long of MyData into Temp
'Perform task with Temp
'Repeat two times
'Perform task with value in Temp
and stores it in
Temp := MyData
and stores it in
method uses the
Index
LONG
MyList
Temp
declaration reads a long of main
= 0) the value $44 ($FF995544’s
Temp
just like we did from
. Further down, in the
, reads the first value in the
. Since the first iteration of
Temp
Index
LONG
, in this case, the value
declaration to read a
= 1) the next byte is
MyList
points at the
DAT
MyData
REPEAT
MyList
block
.

Related parts for 122-32000