Variables in DAT block not getting updated in Parallax serial terminal
Hello,
I'm experimenting with propeller assembly language and trying to view variables using the dec function in the parallax serial terminal object. I can't seem to get a very basic code block to work. For some reason the variable being monitored in PST isn't getting updated, but just shows the value the variable is initialized with. What am doing wrong?
countertest.spin
Thanks in advance
I'm experimenting with propeller assembly language and trying to view variables using the dec function in the parallax serial terminal object. I can't seem to get a very basic code block to work. For some reason the variable being monitored in PST isn't getting updated, but just shows the value the variable is initialized with. What am doing wrong?
countertest.spin
Thanks in advance
spin

728B
Comments
be instead;
view.dec(long[@time]) ???
I tried that and it didn't work either, I get the same results either way. I think I might be trying to use the wrong tool (PST) for the job. It will read whatever I initialize the variable to with either syntax, however it doesn't update. I'll download the lite debug tool and see if that works better.
Cheers,
Brent
The time variable (register) is only changed inside the cog ram of the new started assembly cog. You can't access this variable from a Spin code running in another cog.
The compiler builds an image of the assembly code in the hub ram, which is then loaded to the cog ram at cognew. Now the assembly code runs independant inside the cog and the hub ram image stays always at its initial state. If you access the time variable from Spin you read the hub ram version.
To see the time value you need to write it to the hub ram inside the assembly cog. For that you need the hubram address of time, the simplest is you pass that in the par register:
cognew(@compaddress, @time)
then you write the current value inside the :loop, i.e.right after the waitcnt instruction:
wrlong time,par
Now you should see a change of the value.
Andy