Update resolver to 15.2

This commit is contained in:
Joscha 2020-03-25 14:58:40 +00:00
parent bbd0707a6d
commit 3e0f4e22b1
4 changed files with 6 additions and 11 deletions

View file

@ -107,8 +107,6 @@ parseSmallInstruction mw = do
so <- parseSmallOpcode (getSmallOpcode mw)
pure $ SmallInstruction so (getLargeValue mw)
-- Assumes that all bits not part of the opcode are zeroed. The opcode
-- uses the lowest four bits.
parseSmallOpcode :: Opcode -> Either T.Text SmallOpcode
parseSmallOpcode w = case smallOpcodeMap Map.!? w of
Just oc -> pure oc
@ -120,8 +118,6 @@ parseLargeInstruction mw = do
lo <- parseLargeOpcode (getLargeOpcode mw)
pure $ LargeInstruction lo (getSmallValue mw)
-- Assumes that all bits not part of the opcode are zeroed. The opcode
-- uses the lowest four bits.
parseLargeOpcode :: Opcode -> Either T.Text LargeOpcode
parseLargeOpcode w = case largeOpcodeMap Map.!? w of
Just oc -> pure oc

View file

@ -25,7 +25,6 @@ import Control.Monad.Trans.Except
import Control.Monad.Trans.Reader
import Data.Bits
import qualified Data.Map.Strict as Map
import Data.Maybe
import qualified Data.Text as T
import Mima.Flag
@ -99,7 +98,7 @@ runExecution :: Flags (MimaAddress -> Bool) -> Execution a -> Either AbortReason
runExecution f exec = runExcept $ runReaderT exec f
failWith :: AbortReason -> Execution a
failWith = lift . except . Left
failWith = lift . throwE
incrementIAR :: MimaState -> Execution MimaState
incrementIAR ms =