diff options
Diffstat (limited to 'ABC/Machine')
-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 |
4 files changed, 11 insertions, 0 deletions
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} |