PSAD and variables question
Hi All,
I am trying to debug some PASM code with PSAD and I haven't been able to figure out how to pass a Global variable to the cog that I am trying to debug. Any Ideas?
RS_Jim
I am trying to debug some PASM code with PSAD and I haven't been able to figure out how to pass a Global variable to the cog that I am trying to debug. Any Ideas?
RS_Jim
Comments
Andy
PUB
...
global_variable_pointer := @global variable
... somme codes etc.
DATA
'your cog's asm program
wrbyte local_cog_variable, global_variable_pointer 'moves data in local_cog_variable to global variable
...
local_cog_variable byte
or you can use the par register as below
cognew(@cogprog,@variablex)
..
cogprog
mov par,data
which loads data into the variablex through the par register
Another question, can I start another cog to run in the background while I am running PSAD. Putting the debug start in a top object and starting the "debugged" obj in the same way as I would any other cog? I want to observe the interaction of the variables between the two cogs while debuging one.
RS_Jim
Be aware that the debugged cog first goes in a Break and you have to start it with F5, while the other cog(s) run direct after the download.
Also Breakpoints and single stepping only happens to the debugged cog, the others just continue.
Andy
I will give that a try!.
RS_Jim
I finally got PSAD working like it should! Now if I could just figure out what the error is in my logic! lol.
RS_Jim