title: Interrupt and Resume Code
body: <p>I have queue with objects, wich are executed sequentially. There is no operating system, I'm just using the hardware and my code:</p>
  
  <pre><code>while(true) {
      if( next = queue.next() ) {
          next-&gt;do_stuff()
      }
  }
  </code></pre>
  
  <p>Now I want to suspend the code which is executed at <code>next-&gt;do_stuff()</code>, based on some hardware interrupts (there are no more details needed about the hardware interrupts). This suspend should save the state (current instruction) and enqueue the <code>next</code> back to the queue, so that the next <code>do_stuff</code> of this <code>next</code> starts at the last instruction, before suspending it. I know, how to safe the state, but I have no idea, how to return from <code>do_stuff</code>. I think, this should be done with assembly.</p>
  
  <p>Some Buzzwords what to search for, would be really nice. Thanks :)</p>