t >>| tell [BCJmp endif, BCLab else] >>|
e >>| tell [BCLab endif]
)
+
instance noOp ByteCode where
noOp = tell` [BCNop]
\end{lstlisting}
-\todo{Add return instruction}
+The semantics for the \glspl{mTask} bytecode view are different than the
+semantics for the \gls{C} view. \glspl{Task} in the \gls{C} view can start new
+\gls{Task} or themselves to continue, while in the bytecode view, \gls{Task}
+run idefinitly, one-shot or on interrupt. To allow interval and interrupt
+\glspl{Task} to terminate, a return instruction is added. This class was not
+available in the original system and is thus added. It just writes a single
+instruction so that the interpreter knows to stop execution.
+Listing~\ref{lst:return} shows the classes and implementation for the return
+expression.
+
+\begin{lstlisting}[label={lst:return},%
+ caption={Bytecode view for the return instruction}]
+class retrn v where
+ retrn :: v () Expr
+
+instance retrn ByteCode where
+ retrn = tell` [BCReturn]
+\end{lstlisting}
\subsection{Shared Data Sources \& Assignment}
Shared data sources must be acquired from the state and constructing one