Launching an ASM routine from a different object
Nefastor
Posts: 14
Hi all,
I can't find information on the syntax of cognew / coginit for this particular case :
- I have an object "A.spin", which declares an instance of object "B.spin", like so :
Object B contains a DAT block with some assembler (let's say at label :start)
And then in object A I want to have a cog running that assembler.
The chip's manual only shows how to launch a cog to run assembler if the DAT block is in the same object as the cognew instruction :
So what do I do ? I tried a few obvious things like cognew (BINST.start, parameter) but none of it compiles, it keeps saying it expects either a variable, or an expression, or something else...
Of course there's always the quick-and-dirty fix of copying all my code into a single object, but that's not the point of having objects now is it ?
I hope you guys can shed some light on this issue, thanks [noparse]:D[/noparse]
Jean
I can't find information on the syntax of cognew / coginit for this particular case :
- I have an object "A.spin", which declares an instance of object "B.spin", like so :
OBJ BINST : "B"
Object B contains a DAT block with some assembler (let's say at label :start)
And then in object A I want to have a cog running that assembler.
The chip's manual only shows how to launch a cog to run assembler if the DAT block is in the same object as the cognew instruction :
cognew (@start, parameter)
So what do I do ? I tried a few obvious things like cognew (BINST.start, parameter) but none of it compiles, it keeps saying it expects either a variable, or an expression, or something else...
Of course there's always the quick-and-dirty fix of copying all my code into a single object, but that's not the point of having objects now is it ?
I hope you guys can shed some light on this issue, thanks [noparse]:D[/noparse]
Jean
Comments
To call from A.spin the B.asm running cog, you must have some like this:
So from A.spin you call it: BINST.Start and that runs the asm code in the another cog.
Regards.
Alberto.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Man I can't wait for my chips to arrive so I can start running this code [noparse]:)[/noparse]
Jean