@@@
User Name
Posts: 1,451
There was a discussion some time ago about the @@@ operator. I spent some time looking for that thread w/o success. IIRC it was specific to BST, which I don't use. What would its equivalent be in PropTool SPIN?
Comments
http://forums.parallax.com/showthread.php?110875-Reference-inside-of-DAT-block&highlight=foobar
From the BST manual then:
5.2
@@@ - The absolute address operator
In SPIN methods, there are the @ & @@ operators. In PASM you have @. In all contexts they mean
different things.
In SPIN, @ means Give me the HUB address of that variable. The interpreter does this at runtime as it only
knows the absolute address when it know where it is in the Propeller. This applies to global (VAR), Local
(PUB/PRI) and PASM (DAT) variables. The @ always returns the address of that variable in the HUB.
In SPIN, @@ means give me the compile-time offset (It's only used when referencing variables in a DAT
block) plus the object base address (this results in the correct absolute HUB address). Again, its a runtime
operator only.
In PASM, @ means Give me the offset of this symbol into the DAT section. It is a relative value with its
base as the start of the objects DAT block.
The @@@ operator results in a compile-time constant that gives the absolute hub address of the symbol in
question. It's a special use symbol and it's not widely used. If you know you need it, you know what it is.
Warning : The Propeller Tool will compile the @@@ operator as valid code in a SPIN method, however it will
give a result far from what you want it to do!
@PeterJakacki: Thanks for the great clarifications. As fate would have it, it is your modification of HS-SerialRx (which I was trying to compile with PropTool) that led to the OP. Perhaps the simplest solution is just to use BST, although I'd imagine that there is some established way to return the HUB address of a specified symbol in PropTool.
I don't know of an equivalent that works across objects in the Spin tool. The normal @symbol+$10 works fine as long as it's not an included object.