Thread: Is this an example of a co-routine?

  1. #1
    Registered User
    Join Date
    Apr 2010
    Location
    Vancouver
    Posts
    132

    Is this an example of a co-routine?

    I am trying to figure out what a co-routine is and is it a block of assembly code that performs one function?

    Code:
    ...
    LDMFD{sp!, R0-R4}
    
    Label: start_of_function
    STMFD{sp!, R0-R1}
    Label: jump_here
    MOV R0, #1
    ADD R1, R0, R0
    branch =x
    swi 0x11
    LDMFD{sp!, R0-R1}
    
    STMFD{sp! R0-R3}
    bl come_here
    ...
    Would the code between
    Code:
    STMFD{sp!, R0-R1}
    and
    Code:
    LDMFD{sp!, R0-R1}
    be considered a co-routine (but not a subroutine since it has multiple points of entry)?

  2. #2
    Unregistered User Yarin's Avatar
    Join Date
    Jul 2007
    Posts
    2,158
    A coroutine is a path that can be stopped/interrupted and later started/resumed. Anything from a thread to an iterator can be seen as a coroutine. It's pretty broad in it's usage. Don't let "multiple entry points" throw you off.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Name for this procedure/routine?
    By Striph in forum C Programming
    Replies: 2
    Last Post: 06-23-2009, 09:09 AM
  2. Help with my XOR routine..
    By Neo1 in forum C++ Programming
    Replies: 9
    Last Post: 10-04-2007, 03:30 PM
  3. validation routine help plz
    By rajesh23 in forum C Programming
    Replies: 8
    Last Post: 09-23-2003, 07:21 AM
  4. rounder routine
    By ustuzou in forum C++ Programming
    Replies: 3
    Last Post: 03-17-2002, 08:41 AM
  5. C Routine for a Date
    By kgiles in forum C Programming
    Replies: 3
    Last Post: 12-28-2001, 05:10 PM