Switch to Mima.Format formatting
This commit is contained in:
parent
81fee29490
commit
4707e929ef
3 changed files with 8 additions and 52 deletions
|
|
@ -11,6 +11,7 @@ module Mima.Instruction
|
|||
import qualified Data.Map.Strict as Map
|
||||
import qualified Data.Text as T
|
||||
|
||||
import Mima.Format.Common
|
||||
import Mima.Util
|
||||
import Mima.Word
|
||||
|
||||
|
|
@ -94,8 +95,8 @@ parseSmallInstruction mw = do
|
|||
parseSmallOpcode :: Opcode -> Either T.Text SmallOpcode
|
||||
parseSmallOpcode w = case smallOpcodeMap Map.!? w of
|
||||
Just oc -> pure oc
|
||||
Nothing -> Left $ "Unknown small opcode " <> T.pack (show w)
|
||||
<> " (" <> integralToHex 1 w <> ")"
|
||||
Nothing -> Left $ "Unknown small opcode " <> toDec w <> " (" <> (fixWidthHex 1 $ toHex w)
|
||||
<> ", " <> (fixWidthBin 4 $ toBin w) <> ")"
|
||||
|
||||
parseLargeInstruction :: MimaWord -> Either T.Text Instruction
|
||||
parseLargeInstruction mw = do
|
||||
|
|
@ -107,8 +108,8 @@ parseLargeInstruction mw = do
|
|||
parseLargeOpcode :: Opcode -> Either T.Text LargeOpcode
|
||||
parseLargeOpcode w = case largeOpcodeMap Map.!? w of
|
||||
Just oc -> pure oc
|
||||
Nothing -> Left $ "Unknown large opcode " <> T.pack (show w)
|
||||
<> " (" <> integralToHex 1 w <> ")"
|
||||
Nothing -> Left $ "Unknown large opcode " <> toDec w <> " (" <> (fixWidthHex 1 $ toHex w)
|
||||
<> ", " <> (fixWidthBin 4 $ toBin w) <> ")"
|
||||
|
||||
instructionToWord :: Instruction -> MimaWord
|
||||
instructionToWord (SmallInstruction so lv) = wordFromSmallOpcode (smallOpcodeNr so) lv
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue