Yes, I also found it very rewarding when my scheduler eventually worked. Saving and restoring the registers was quite tricky. I eventually decided to just save them on the thread's stack so I wouldn't have to worry about registers being clobbered by the context switching code.