Browse Source

VM: annotations for missing instructions

master
Denis Tereshkin 4 years ago
parent
commit
3d4632e498
  1. 6
      src/Nand2Tetris/VM.hs

6
src/Nand2Tetris/VM.hs

@ -70,6 +70,12 @@ instrAnnotation :: VMInstruction -> T.Text
instrAnnotation (VMArithmetic ACAdd) = "add" instrAnnotation (VMArithmetic ACAdd) = "add"
instrAnnotation (VMArithmetic ACSub) = "sub" instrAnnotation (VMArithmetic ACSub) = "sub"
instrAnnotation (VMArithmetic ACNeg) = "neg" instrAnnotation (VMArithmetic ACNeg) = "neg"
instrAnnotation (VMArithmetic ACEq) = "eq"
instrAnnotation (VMArithmetic ACGt) = "gt"
instrAnnotation (VMArithmetic ACLt) = "lt"
instrAnnotation (VMArithmetic ACAnd) = "and"
instrAnnotation (VMArithmetic ACOr) = "or"
instrAnnotation (VMArithmetic ACNot) = "not"
instrAnnotation (VMMemAccess accessType segment) = instrAnnotation (VMMemAccess accessType segment) =
strAccessType <> " " <> strSegment strAccessType <> " " <> strSegment
where where

Loading…
Cancel
Save