Hacker News new | ask | show | jobs
by anfilt 2369 days ago
Yea done that myself, save all the register states, save the stack pointer, and then set a new stack pointer and load all that tasks register states.

Although doing the same on windows is kinda annoying. Also the amount callee saved registers is kinda like what the heck. Here is some code I wrote doing that for window's ABI. https://pastebin.com/jnxeMRcV