Using array of longs in PASM
maroy
Posts: 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
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.
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
you could use res 3 instead of long 0 [3] as you are setting up the values prio to use.