Passing PAR to assembly
Hack Saw
Posts: 3
Hello Everyone,
I am new to the propeller. I am quite proficient with the SX stuff, but my program has outgrown the space available in the SX so I am "upgrading" to the propeller.
Here is my question....
Runing spin is waaay to slow for my application. I have managed to get my high speed requirements to run in prop assembly, and my intention· is to let the slower less critical functions (vfd display,·some buttons, etc.)·run in spin on a different cog. I need to have my assembly code share main memory with my spin code.·I have been able to pass the address of a long to assembly using the PAR register as described in the manual on page 283. But, I need several words in my assembly code. I am using 1 long as 2 words now, but I would like to address thm seperately, and ultimately have more main memory available to be shared·between spin and·assembly.·I am sure this is easy, but I can't find anything in the manual about it.
Please help.
I am new to the propeller. I am quite proficient with the SX stuff, but my program has outgrown the space available in the SX so I am "upgrading" to the propeller.
Here is my question....
Runing spin is waaay to slow for my application. I have managed to get my high speed requirements to run in prop assembly, and my intention· is to let the slower less critical functions (vfd display,·some buttons, etc.)·run in spin on a different cog. I need to have my assembly code share main memory with my spin code.·I have been able to pass the address of a long to assembly using the PAR register as described in the manual on page 283. But, I need several words in my assembly code. I am using 1 long as 2 words now, but I would like to address thm seperately, and ultimately have more main memory available to be shared·between spin and·assembly.·I am sure this is easy, but I can't find anything in the manual about it.
Please help.
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I am 1011, so be surprised!
Advertisement sponsored by dfletch:
Come and join us on the Propeller IRC channel for fast and easy help!
Channel: #propeller
Server: irc.freenode.net or freenode.net
If you don't want to bother installing an IRC client, use Mibbit. www.mibbit.com
Typically, you move PAR to some other location and increment it there as needed.
First COG address is 0, second is 1, third is 2, etc...
In the HUB, each atomic address is a byte!
So,
Say you've got a word, a long and two bytes, stored sequentially in the HUB. Pass the address of the word to PAR in the cognew.
Then do:
mov temp, PAR
rdlong A, temp
add temp, #4
rdword B, temp
add temp, #2
rdbyte C, temp
add temp, #1
rdbyte D, temp.
A,B,C,D are all longs in the COG, addressed sequentially thus:
DAT
A long 0 'holds a long
B long 0 'long holds a word
C long 0 'long holds a byte
D long 0 'long holds another byte.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Wiki: Share the coolness!
Chat in real time with other Propellerheads on IRC #propeller @ freenode.net
So does this mean that in the case of 'C long holds a byte' that the byteis represented by the least significant 8 bits of C long and that the upper 24 bits are just wasted space?
Also if you want it to be signed, you'd have to then do the following to it, before doing anything to it.
or for words
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
http://www.propgfx.co.uk/forum/·home of the PropGFX Lite
·