aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ABC/Assembler.dcl1
-rw-r--r--ABC/Assembler.icl1
-rw-r--r--ABC/Machine/BStack.dcl1
-rw-r--r--ABC/Machine/BStack.icl4
-rw-r--r--ABC/Machine/Instructions.dcl2
-rw-r--r--ABC/Machine/Instructions.icl4
6 files changed, 13 insertions, 0 deletions
diff --git a/ABC/Assembler.dcl b/ABC/Assembler.dcl
index 2c6894a..1203248 100644
--- a/ABC/Assembler.dcl
+++ b/ABC/Assembler.dcl
@@ -88,6 +88,7 @@ from ABC.Machine.GraphStore import ::Desc
| NegI
| RemI
| SubI
+ | NotB
// Clean compiler additions
| Comment String
| Annotation Annotation
diff --git a/ABC/Assembler.icl b/ABC/Assembler.icl
index ca121a8..9cf2961 100644
--- a/ABC/Assembler.icl
+++ b/ABC/Assembler.icl
@@ -202,3 +202,4 @@ where
trans NegI _ _ = negI
trans RemI _ _ = remI
trans SubI _ _ = subI
+ trans NotB _ _ = notB
diff --git a/ABC/Machine/BStack.dcl b/ABC/Machine/BStack.dcl
index 9d938ef..9a0041d 100644
--- a/ABC/Machine/BStack.dcl
+++ b/ABC/Machine/BStack.dcl
@@ -39,3 +39,4 @@ bs_mulI :: BStack -> BStack
bs_negI :: BStack -> BStack
bs_remI :: BStack -> BStack
bs_subI :: BStack -> BStack
+bs_notB :: BStack -> BStack
diff --git a/ABC/Machine/BStack.icl b/ABC/Machine/BStack.icl
index a9a2d0e..ab96d60 100644
--- a/ABC/Machine/BStack.icl
+++ b/ABC/Machine/BStack.icl
@@ -113,3 +113,7 @@ bs_remI _ = abortn "bs_remI: no integers"
bs_subI :: BStack -> BStack
bs_subI [Int m:Int n:s] = bs_pushI (m - n) s
bs_subI _ = abortn "bs_subI: no integers"
+
+bs_notB :: BStack -> BStack
+bs_notB [Bool b:s] = bs_pushB (not b) s
+bs_notB _ = abortn "bs_notI: no integer"
diff --git a/ABC/Machine/Instructions.dcl b/ABC/Machine/Instructions.dcl
index d5a37f9..2c580e6 100644
--- a/ABC/Machine/Instructions.dcl
+++ b/ABC/Machine/Instructions.dcl
@@ -65,3 +65,5 @@ mulI :: State -> State
negI :: State -> State
remI :: State -> State
subI :: State -> State
+
+notB :: State -> State
diff --git a/ABC/Machine/Instructions.icl b/ABC/Machine/Instructions.icl
index 54e7ebd..37c436d 100644
--- a/ABC/Machine/Instructions.icl
+++ b/ABC/Machine/Instructions.icl
@@ -396,3 +396,7 @@ remI st=:{bstack}
subI :: State -> State
subI st=:{bstack}
= {st & bstack=bs_subI bstack}
+
+notB :: State -> State
+notB st=:{bstack}
+ = {st & bstack=bs_notB bstack}