better serial integration, moved things outside
[mTask.git] / mTaskInterpret.icl
index f0cddf9..4876e93 100644 (file)
@@ -229,9 +229,9 @@ instance zero BCState where
        zero = {freshl=[1..], freshs=[1..], sdss=[]}
 
 
-toRealByteCode :: (ByteCode a b) -> (String, BCState)
-toRealByteCode x
-# (bc, st) = runBC x zero
+toRealByteCode :: (ByteCode a b) BCState -> (String, BCState)
+toRealByteCode x s
+# (bc, st) = runBC x s
 # (bc, gtmap) = computeGotos bc 1
 = (concat $ map (toString o toByteVal) (map (implGotos gtmap) bc), st)
 
@@ -265,7 +265,7 @@ toMessages interval (bytes, st=:{sdss}) = ([MTSds i (toString b)\\(i,b)<-sdss] +
 toSDSUpdate :: Int Int -> [MTaskMSGSend]
 toSDSUpdate i v = [MTUpd i (to16bit v)]
 
-Start = toMessages 500 $ toRealByteCode (unMain bc)
+Start = toMessages 500 $ toRealByteCode (unMain bc) zero
        where
                bc = sds \x=5 In 
                        sds \y=4 In