I'm at the point now where I'm writing HUBEXEC code. And it's cool. For a while, I just kept it simple, COG code only, but I've got the basic COG functions I need to proceed with a larger project done, and I'm pretty sure it won't fit into a COG. Even if it does, I want to do it HUBEXEC.
Everything went fine, until I wanted to use COG Registers as working registers. Somewhere in this long discussion, we talked about that, and I can't seem to remember or find the detail on it.
Say I want to do something like this: [edited for clarity, both orgs needed]
play jmp #hubex 'game loop to go here, hubexec
gtemp long 0 'COG working temp registers for computation
gtemp1 long 0
orgh $21000 'hubexec, just for clarity
hubex mov dirb, #$f
.loop testb inb, #24 wz
'this works as expected, no worries
if_z wrlong ##@blitlist, ##@bmail
if_nz wrlong ##@startlist, ##@bmail
rdlong gtemp, ##@score 'this works, reference "org 0" for COG register address
Both orgs needed, and shown for clarity, rest of thread left for archive.