stupid question
Lee Marshall
Posts: 106
hi, i just got my first propeller chip, and have finally got it to work(made programmer out of breadboard).
i am curious about the cognew/init instructions.
when starting a cog with the address of asm code(instead of spin subroutine), you can pass a parameter address, not a stack pointer. where does the cog put its return addresses??
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The Z80 Rocks!
In a world without walls and fences, who needs windows and gates?
i am curious about the cognew/init instructions.
when starting a cog with the address of asm code(instead of spin subroutine), you can pass a parameter address, not a stack pointer. where does the cog put its return addresses??
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The Z80 Rocks!
In a world without walls and fences, who needs windows and gates?
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The Z80 Rocks!
In a world without walls and fences, who needs windows and gates?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The Z80 Rocks!
In a world without walls and fences, who needs windows and gates?
Anyway, there isn't a call stack. It's possible to emulate one with fairly low overhead. The "Large Memory Model" developed by Bill Henning has one version with a call stack in cog memory that would probably involve 5-6 extra instructions for the call and 3-4 for the return.
When you COGINIT/COGNEW to ASM, that ASM code is executing on separate processor (COG) with it's own 496x32 words of local RAM.· It can interact with the outside world via the 32 I/O pins (shared access) or the 32K of shared (HUB) RAM & locks.· Similarly, the SPIN code is actually an interpretter running on it's own processor, reading code from the shared RAM.· SPIN code can access SPIN subroutines because it's all sitting in shared RAM.
Now, if you're talking about subroutines written in ASM (and loaded with the rest of the code in local RAM), then I recommend you look at the JMPRET instruction.··· There has been some discussion of dynamically loadable (and relocatable) subroutines in the forum, but I don't think anyone has implemented anything yet.
* A SPIN subroutine could be triggered by ASM code through some kind of shared RAM/lock handshake.
·
As a former Z80 fan, have you found that the Propeller Whirs better than the Z80 Rocks?
thanks for all ur help, ppl.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The Z80 Rocks!
In a world without walls and fences, who needs windows and gates?
with the propeller almost EVERYTHING can be done by a cog
there are a lot of code-parts a little bit like "drivers" for
a serial connection with 115kBAUD
and if you would like to have 5 DIFFERENT serial connections
you just start up 5 cogs doing all the details needed for a FULL-DUPLEX serial receiving/transmitting connection everyone at 115kBAUD !
or 3 DIFFERENT SPI-buses or 4 I2C-buses whatever you like
only limited by the number of 8 cogs inside one Propeller-chip
just take a look through the demofiles and the object-eschange download section
so to say "the propeller spins !"
greetings
Stefan
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The Propeller is the best micro!
srry if im sound a little unprofessional sometimes, im 15.
If by "call stacks", you mean a general stack mechanism where both data and return addresses can be pushed/popped, that's a different animal (a completely different computer design).
Spin does have a stack architecture with the stack implemented in the much larger HUB RAM.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.