This can be implemented without assembly using setcontext/getcontext on POSIX-compatible systems, and GetThreadContext/SetThreadContext on Windows.
https://github.com/stevedekorte/io/blob/master/libs/coroutin...
https://github.com/stevedekorte/io/blob/master/libs/coroutin...
I do not pretend to know about Windows internals so I won't comment on Windows.
[1] http://www.boost.org/doc/libs/1_54_0/libs/context/doc/html/c...