Is this an example of a co-routine?

This is a discussion on Is this an example of a co-routine? within the Tech Board forums, part of the Community Boards category; I am trying to figure out what a co-routine is and is it a block of assembly code that performs ...

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

    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
    1,532
    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.
    A class that doesn't overload all operators just isn't finished yet. -- SmugCeePlusPlusWeenie
    A year spent in artificial intelligence is enough to make one believe in God. -- Alan J. Perlis

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, 07:41 AM
  5. C Routine for a Date
    By kgiles in forum C Programming
    Replies: 3
    Last Post: 12-28-2001, 04:10 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21