CassLan
12-23-2009, 08:50 PM
Almost done watching the ASM Webinar...thanks so much for it Parallax!
I have a question at about 39 minutes in this code is up and being discussed:
CON
_clkmode = xtal1 + pll16x
_xinfreq = 5_000_000
VAR
long Count
OBJ
pst : "Parallax Serial Terminal"
PUB Main
pst.start(115200)
cognew(@Asm, @Count)
repeat
pst.Dec(Count)
pst.NewLine
waitcnt(clkfreq / 100 + cnt)
DAT
Asm org
mov Addr, par 'Get Spin variable address
Loop add Value, #1 'Add 1 to Value
wrlong Value, Addr 'Write Value to Spin variable
jmp #Loop 'Loop
Addr long 0
Value long 0
It was brought up to illustrate passing information from Spin, to a new Asm cog being launched..and I guess vice/versa
So the par register of the new cog, now contains the·address of Count?
Then the first line of Asm code copies that address to the long known as Addr?
So Now..the long Addr which resides in cogram contains the address of the long Count which resides in main ram?
the long Value which resides in cogram gets incremented by 1
Then the contents of the long Value get written to the address Addr which is really the long Count in mainram?
Then it loops around.
Do I have this right? Why can't you leave the par register with the needed address first passed to it?
If I had a DAT Section which contained Longs BEFORE the org statement..is that kept in Main RAM?
If I have 2 Assembly routines each under 496 Longs each meant to run in seperate cogs, what stops the 2nd one from being copied into the 496 Long cog ram..the org statement?
Again...what a great Webinar!!!!!
Rick
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
NYC Area Prop Club (http://www.gothampropclub.com)
Prop Forum Search (Via Google) (http://search.parallax.com/search?site=parallax&client=parallax&output=xml_no_dtd&proxystylesheet=parallax&proxycustom=<HOME/>&ie=&oe=&lr=)
·
I have a question at about 39 minutes in this code is up and being discussed:
CON
_clkmode = xtal1 + pll16x
_xinfreq = 5_000_000
VAR
long Count
OBJ
pst : "Parallax Serial Terminal"
PUB Main
pst.start(115200)
cognew(@Asm, @Count)
repeat
pst.Dec(Count)
pst.NewLine
waitcnt(clkfreq / 100 + cnt)
DAT
Asm org
mov Addr, par 'Get Spin variable address
Loop add Value, #1 'Add 1 to Value
wrlong Value, Addr 'Write Value to Spin variable
jmp #Loop 'Loop
Addr long 0
Value long 0
It was brought up to illustrate passing information from Spin, to a new Asm cog being launched..and I guess vice/versa
So the par register of the new cog, now contains the·address of Count?
Then the first line of Asm code copies that address to the long known as Addr?
So Now..the long Addr which resides in cogram contains the address of the long Count which resides in main ram?
the long Value which resides in cogram gets incremented by 1
Then the contents of the long Value get written to the address Addr which is really the long Count in mainram?
Then it loops around.
Do I have this right? Why can't you leave the par register with the needed address first passed to it?
If I had a DAT Section which contained Longs BEFORE the org statement..is that kept in Main RAM?
If I have 2 Assembly routines each under 496 Longs each meant to run in seperate cogs, what stops the 2nd one from being copied into the 496 Long cog ram..the org statement?
Again...what a great Webinar!!!!!
Rick
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
NYC Area Prop Club (http://www.gothampropclub.com)
Prop Forum Search (Via Google) (http://search.parallax.com/search?site=parallax&client=parallax&output=xml_no_dtd&proxystylesheet=parallax&proxycustom=<HOME/>&ie=&oe=&lr=)
·