@ operator in Spin
David Betz
Posts: 14,516
Can someone remind me of the rules for using the @ operator. I think I'm getting in trouble by trying to pass the address of variables to PASM code. Does that work? Or do I need to put those variables in a DAT section?
VAR long foo DAT bar long 0 PUB test | x x := @foo ' do I get a hub address here? x := @bar ' do I get a hub address here?
Comments
Yes to both questions. Only @ usage in DAT sections needs special care.
Makes sense in a way. So we need to see some more.
You probably using @ again inside it, though the var you passed to it was the @address.
So attach the complete zip file
pkt.zip
Can you explain what the structure and data you are trying to pass to cog and I will try show how I would do the mailbox.
Length is lower 9 bit so you can use it in the pasm as is, with movs.
pkt.zip