Shop OBEX P1 Docs P2 Docs Learn Events
Using array of longs in PASM — Parallax Forums

Using array of longs in PASM

maroymaroy Posts: 1
edited 2014-01-27 11:26 in Propeller 1
This is a pretty basic stylistic / syntax question regarding explicit indexing into an array of longs in an assembly code block.
Here is the pattern I would like to use
DAT

<snip>

mov  item, #0              'basic destination argument
mov  item + 1, #1        ' is this destination the second of three longs starting at item or should it be +4?
mov  item + 2, #0        ' is this destination the third of three longs starting at item or should it be + 8?

<snip>

mov  item + 1,  item + 2     'would this move the value at the third long to the second long?

<snip>

item  long  0 [3]  'three longs starting at the tag item

The compiler does not complain about this syntax, but I have not seen this pattern used in any sample programs. The manual does not state how the '+' operator affects the src or dest. when used in this manner. Even though the compiler does not complain I am not really sure it is doing what I think it should do.

Comments

  • tonyp12tonyp12 Posts: 1,951
    edited 2014-01-27 11:26
    +1 etc will work just fine, of course it's calculated at compile and you can not be use in run-time code as a flying offset.

    you could use res 3 instead of long 0 [3] as you are setting up the values prio to use.
Sign In or Register to comment.