AN014: Coroutines in Propeller Assembly Language

Keywords: 
coroutine, multi-tasking, cooperative tasks, interrupts, JMPRET, CALL, JMP, P8X32A
Abstract: 

Abstract: The multicore P8X32A does not require traditional interrupts to manage multiple processes simultaneously; yet multi-tasking in a  single core is still a handy option. Coroutines in Propeller Assembly language can support a pair of independent tasks in a single core (cog) through the use of the JMPRET instruction.

Comments

Momentarily the swap-over code is eating up too much time or rather more time than necessary. The user code jumps to it and then jumps back (8 cycles).

- replace [call #swap] with [jmpret swap,swap]
- replace [swap/swap_ret] with [swap long pong]

FullDuplexSerial uses this in a slightly modified form already so I'm surprised this AppNote uses a less efficient form.