assembly code goes in hub ram or cog ram?
fezmonkey
Posts: 41
I have gone through some docs but I have this foggy area!
Please correct me if I am wrong
Is it correct that the assembly code is loaded/executed in the cog's memory?
This assembly code can use the same cog memory for data but there are instructions to access the hub memory?
The spin interpreter is loaded in cog0 (or other) and then the spin program is loaded in the hub for interpreter to execute? But where is it loaded in the hub ram?
I guess my biggest point of confusion is that if you write code that is asm/spin then where does your program go? hub ram or cog ram?
Then also, when I make a new "newcog" then how is the program loaded and what is the mechanism for starting the new cog?
Please correct me if I am wrong
Is it correct that the assembly code is loaded/executed in the cog's memory?
This assembly code can use the same cog memory for data but there are instructions to access the hub memory?
The spin interpreter is loaded in cog0 (or other) and then the spin program is loaded in the hub for interpreter to execute? But where is it loaded in the hub ram?
I guess my biggest point of confusion is that if you write code that is asm/spin then where does your program go? hub ram or cog ram?
Then also, when I make a new "newcog" then how is the program loaded and what is the mechanism for starting the new cog?
Comments
I was like you when I started with Propeller but I soon got all that sorted after going throught those online manual @ http://www.parallax.com/tabid/832/Default.aspx#Manuals and doing those examples in PE kit.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.mikronauts.com E-mail: mikronauts _at_ gmail _dot_ com
My products: Morpheus / Mem+ / PropCade / FlexMem / VMCOG / Propteus / Proteus / SerPlug
and 6.250MHz Crystals to run Propellers at 100MHz & 5.0" OEM TFT VGA LCD modules
Las - Large model assembler Largos - upcoming nano operating system
Whenever you do a cognew giving another funktion, another SPIN interpreter is loaded into another COGs RAM which executes the SPIN function. Again the SPIN code stays in HUB-RAM.
Whenever you do a cognew giving a pointer to a dat section the 496 longs will be loaded into the COG-RAM.
It's easy ... all PASM code runs in COG-RAM - the SPIN interpreter is also a PASM program ... all SPIN code stays in HUB-RAM.
After that, there are 2 options to start other cogs:
1. a cognew on spin code causes new cog to start with spin interpreter that would run the corresponding spin code
2. a cognew on pasm code causes the pasm code to be copied from hub ram to the new cogs ram and then the new cog start executing it
Is this correct?
PASM instructions like wrlong/rdlong and friends, lockset and friends, coginit, cogid, etc... all use round-robin access to hub memory. It is often easier and in some cases faster to use rd/wr PASM variants instead of using self-modifying code in a cog for manipulating data.
Cheers.
--Steve
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Pages: Propeller JVM