Newbie ASM Question-Resolved
tom90
Posts: 55
Hey All,
Can I make arrays in asm and pass them to cogs running spin? I want to continually write word sized data into 150 memory spaces until i tell it to stop, then i can manipulate the data in the 150 words. Can i make an array of 150 words in asm, and if so how?
Thanks
Tom
Post Edited (tom90) : 2/24/2009 8:40:26 PM GMT
Can I make arrays in asm and pass them to cogs running spin? I want to continually write word sized data into 150 memory spaces until i tell it to stop, then i can manipulate the data in the 150 words. Can i make an array of 150 words in asm, and if so how?
Thanks
Tom
Post Edited (tom90) : 2/24/2009 8:40:26 PM GMT
Comments
Cheers!
Paul ROwntree
http://forums.parallax.com/showthread.php?p=786265
You just declare the array in spin, and give your asm routine (not yet launched) the address via the @ operator:
There are other ways
Ale, i have already used the parameter for another variable (I should have mentioned this in my first post). That being said, I think I figured out how to take care of my problem without using an array.
Thanks for your responses.
Tom
wrlong value, par
If the variable address is an array, then how do you reference the other indexes of the array
I have tried, but it did not work
wrlong value, par+1
·········· mov ptr_to_array, PAR
···········add ptr_to_array,#1····· 'reference to array element [noparse][[/noparse]1]
···········wrbyte number,ptr_to_array
······· ptr_to_array·· long·· 0
@those who are skilled with ASM is this the right way?
thanks
Jeff T.
EDIT: the above is not the original solution I posted , I walked away from the computer and realized I had unwittingly answered my own question ( I think ). I too was at first trying to solve it using the "+" operater , a mild case of tunnel vision. If the above is indeed correct I see it is a considerable advancement , for now with using Spin and a serial object I can debug the results of sample asm code to a terminal.
Post Edited (Unsoundcode) : 2/26/2009 7:46:06 PM GMT