A trivial example of using continuation would be implementing a thread (fiber if you wish) manager on a single-processor machine. The scheduler would interrupt the execution flow periodically (or, in the case of fibers, be invoked at various strategic points in the code), save the continuation state (corresponding to the current thread), then switch to a different continuation state (corresponding to a different thread whose state was saved previously.)
Referring to your assembly background, the continuation state would capture such details as instruction pointer, registers, and stack context (pointer), to be saved and restored at will.
Another way of using continuation would be to think of replacing method calls with several thread-like entities that co-exist in parallel (either running or suspended) passing control to each other using continuation contexts instead of the 'classic' call
paradigm. They would operate on global (shared) data instead of relying on parameters. This is to some extent more flexible than call
in the sense that stack does not have to wind up then down (calls
are nested), but control can pass around arbitrarily.
Attempting to visualize this concept in a language such a C, imagine having one big loop with a single switch(continuation_point) { case point1: ... }
statement, where each case
corresponds to a continuation-savepoint, and where the code inside each case
can alter the value of continuation_point
and relinquish control to that continuation_point
by break
ing from the switch
and engaging the next iteration in the loop.
What is the context of your question? Any particular scenarios you are interested in? Any particular programming language? Is the thread/fibre example above sufficient?
Cheers,
V.