diff options
author | Camil Staps | 2017-07-19 12:49:30 +0000 |
---|---|---|
committer | Camil Staps | 2017-07-19 12:49:30 +0000 |
commit | e896db3386454b9e079e9adfc19c1e5b4d8735f9 (patch) | |
tree | 65846e9d5c667aaee1e0c5c83689927aededcf24 /ABC | |
parent | Add negI (diff) |
Add notB
Diffstat (limited to 'ABC')
-rw-r--r-- | ABC/Assembler.dcl | 1 | ||||
-rw-r--r-- | ABC/Assembler.icl | 1 | ||||
-rw-r--r-- | ABC/Machine/BStack.dcl | 1 | ||||
-rw-r--r-- | ABC/Machine/BStack.icl | 4 | ||||
-rw-r--r-- | ABC/Machine/Instructions.dcl | 2 | ||||
-rw-r--r-- | ABC/Machine/Instructions.icl | 4 |
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} |