Trouble with "@" cog address
potatohead
Posts: 10,261
I've attached my text generator code. There is a table in the COG called "pixel_table", and it's offset from the beginning of the cog 90 longs.
Rather than count up all the $(#%*&($#% instructions, I thought it would be simple to just do:
ptable LONG @pixel_table
,or
ptable LONG @pixel_table - @cogstart
to arrive at that 90 longs to use as part of a self-modify pointer index to that table.
That isn't working, and I'm not understanding why this morning. Any hints as to what I've either forgotten, or haven't yet learned?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Wiki: Share the coolness!
Chat in real time with other Propellerheads on IRC #propeller @ freenode.net
Safety Tip: Life is as good as YOU think it is!
Rather than count up all the $(#%*&($#% instructions, I thought it would be simple to just do:
ptable LONG @pixel_table
,or
ptable LONG @pixel_table - @cogstart
to arrive at that 90 longs to use as part of a self-modify pointer index to that table.
That isn't working, and I'm not understanding why this morning. Any hints as to what I've either forgotten, or haven't yet learned?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Wiki: Share the coolness!
Chat in real time with other Propellerheads on IRC #propeller @ freenode.net
Safety Tip: Life is as good as YOU think it is!
spin
73K
Comments
ptable long pixel_table
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
http://www.propgfx.co.uk/forum/·home of the PropGFX Lite
·
Don't ask me why. I had a long debate about this here a long time ago. It still does not make sense to me and I think it's nuts. But there it is and we have to live with it.
What it actually gets you is an address that needs the start of the object adding on to it. This you can get with @0. Some how you have to add that onto all those initialized longs.
I initialize all such things with Spin code now.
If you have BST I belive using @@@ might do what you want to initialize a long but I have never used it.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
Remember that you can use DAT sections as a place to put data referenced from Spin code as well as a place to write assembly code. The "@" operator produces the Spin address of the information while just putting the label by itself produces the cog address. This is complicated by the fact that the Spin compiler doesn't know where it will put the DAT information until after it has compiled everything, hence the need for a "@@" operator.
Post Edited (Mike Green) : 9/19/2009 6:08:35 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
Thanks baggars!
(goes on to building color cog now)
@Mike -- Of course. I did go and read it. When I'm working between COG and HUB, there are times when I end up with conflicts. I think I've got those sorted, but I just flat out didn't consider where I was addressing.
Well, some things are really, really easy now! I messed with this for longer than I care to admit [noparse]:)[/noparse]
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Wiki: Share the coolness!
Chat in real time with other Propellerheads on IRC #propeller @ freenode.net
Safety Tip: Life is as good as YOU think it is!
not really got time to help, out much on here, as I'm full of man-flu, and working from 8am to around midnight, which isn't good when you're healthy, let alone ill.
but all will be done by Wednesday night, and I can then go fall into bed for a few days lol
but I use my little break time, to have a little mooch around this great forum, and if I can help, I do [noparse]:)[/noparse]
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
http://www.propgfx.co.uk/forum/·home of the PropGFX Lite
·