repositories
/
mTask.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed communication
[mTask.git]
/
mTaskInterpret.icl
diff --git
a/mTaskInterpret.icl
b/mTaskInterpret.icl
index
21b53c9
..
0f68ed2
100644
(file)
--- a/
mTaskInterpret.icl
+++ b/
mTaskInterpret.icl
@@
-55,9
+55,9
@@
instance toString MTaskMSGRecv where
bclength :: BC -> Int
bclength (BCPush _) = 3
bclength (BCLab _) = 2
bclength :: BC -> Int
bclength (BCPush _) = 3
bclength (BCLab _) = 2
-bclength (BCSdsStore _) =
2
-bclength (BCSdsFetch _) =
2
-bclength (BCSdsPublish _) =
2
+bclength (BCSdsStore _) =
3
+bclength (BCSdsFetch _) =
3
+bclength (BCSdsPublish _) =
3
bclength (BCAnalogRead _) = 2
bclength (BCAnalogWrite _) = 2
bclength (BCDigitalRead _) = 2
bclength (BCAnalogRead _) = 2
bclength (BCAnalogWrite _) = 2
bclength (BCDigitalRead _) = 2
@@
-69,13
+69,13
@@
bclength _ = 1
toByteVal :: BC -> [Char]
toByteVal b
toByteVal :: BC -> [Char]
toByteVal b
-# bt = toChar $ consIndex{|*|} b
+ 1
+# bt = toChar $ consIndex{|*|} b
= [bt:case b of
(BCPush i) = i
(BCLab i) = [toChar i]
= [bt:case b of
(BCPush i) = i
(BCLab i) = [toChar i]
- (BCSdsStore i) = [
toChar
i]
- (BCSdsFetch i) = [
toChar
i]
- (BCSdsPublish i) = [
toChar
i]
+ (BCSdsStore i) = [
c\\c<-:to16bit
i]
+ (BCSdsFetch i) = [
c\\c<-:to16bit
i]
+ (BCSdsPublish i) = [
c\\c<-:to16bit
i]
(BCAnalogRead i) = [toChar i]
(BCAnalogWrite i) = [toChar i]
(BCDigitalRead i) = [toChar i]
(BCAnalogRead i) = [toChar i]
(BCAnalogWrite i) = [toChar i]
(BCDigitalRead i) = [toChar i]
@@
-159,7
+159,7
@@
BCIfStmt b t e =
b <++> retrn [BCJmpF else] <++> t
<++> retrn [BCJmp endif,BCLab else] <++> e <++> retrn [BCLab endif]
b <++> retrn [BCJmpF else] <++> t
<++> retrn [BCJmp endif,BCLab else] <++> e <++> retrn [BCLab endif]
-instance noOp ByteCode where noOp =
mempty
+instance noOp ByteCode where noOp =
retrn [BCNop]
withLabel :: (Int -> (ByteCode b q)) -> ByteCode b q
withLabel f = BC \s->let [fresh:fs] = s.freshl
withLabel :: (Int -> (ByteCode b q)) -> ByteCode b q
withLabel f = BC \s->let [fresh:fs] = s.freshl