- ;
- ; restore hardware stack
- ;
- move hws,la ; Clear HWS to ensure proper reload
- move hws,la
- pop HWS
- pop HWS
-
- ;
- ; restore all saved registers
- ;
- pop lc
- pop m01
- pop la
- pop omr
-
- pop r3
- pop r2
- pop r1
- pop r0
- pop b2
- pop b1
- pop b0
- pop a2
- pop a1
- pop a0
-
- pop y1
- pop y0
- pop x0
+ ; SR is already pushed on the stack (normal call context). Use RTI to restore
+ ; it, so that interrupt status is preserved across the tasks.
+ rti
+}