It's easy as long as you remember that each entry has to have an exit even if all the exits are the same location:
entry1 nop ' 1st entry
entry2 nop ' 2nd entry
entry3 nop ' 3rd entry
'
entry3_ret ' these labels can be in any order
entry2_ret
entry1_ret ret ' single exit
Note that a CALL instruction is actually a macro that generates a JMPRET instruction, so that "CALL <entry>" generates "JMPRET <entry>_RET,#<entry>". Look in the Propeller manual for a description. The RET is just a JMP instruction with the destination address not filled in. The CALL will do that when it's executed.
Thank you, Mike Green! By using multiple entry points I can run a few cog?
In the object some procedures are written in the PASM (Init, StartMaster, StartSlave).
I need to run a procedure StartMaster or StartSlave depending on the procedure Init.
"I can run a few cog?" ... I'm not sure what you mean. There are no "procedures" in PASM. Usually there's a Spin interface with some methods that are called by your main program and there's a PASM program that's started in a cog by the object's initialization routine. The PASM program and the interface methods communicate via a shared area of memory. You'll need to tell us more about what you're trying to do and you'll need to post your source code. If you're using an existing object, provide a link to it at least. Use the Attachment Manager to attach the source files to a reply (use the Go Advanced button when making your reply).
I've attached my 1-Wire object which demonstrates how to call discrete PASM routines from Spin. The setup and implementation is fairly common and easy to use. This demonstrates what Mike was talking about in post #4.
Usually there's a Spin interface with some methods that are called by your main program and there's a PASM program that's started in a cog by the object's initialization routine. The PASM program and the interface methods communicate via a shared area of memory.
Comments
In the object some procedures are written in the PASM (Init, StartMaster, StartSlave).
I need to run a procedure StartMaster or StartSlave depending on the procedure Init.