Skip to content

Commit

Permalink
Fix code errors & details
Browse files Browse the repository at this point in the history
  • Loading branch information
0rphee committed Jul 16, 2024
1 parent 00f3927 commit b810d2a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions app/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ main = do
(Options sourceCodePath) <- runCmdOptions
putStrLn $ "FILEPATH: " <> sourceCodePath
assemblyCode <- T.readFile sourceCodePath
T.putStrLn assemblyCode
T.putStrLn $ T.replicate 10 "-"
-- T.putStrLn assemblyCode
-- T.putStrLn $ T.replicate 10 "-"
mayStatements <- Expr.mainLocal assemblyCode
case mayStatements of
Nothing -> T.putStrLn "No results to be written"
Expand Down
8 changes: 4 additions & 4 deletions src/Bin.hs
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ getInstOffset = \case

trans :: Map Label Location -> Location -> Instruction -> Put
trans labelMap instrLoc = \case
MOV (RegOp AX) (ImmOp ew) -> putWord8 0xb8 >> treatAsW16 ew
MOV (RegOp BX) (ImmOp ew) -> putWord8 0xbb >> treatAsW16 ew
MOV (RegOp CX) (ImmOp ew) -> putWord8 0xb9 >> treatAsW16 ew
MOV (RegOp AX) (ImmOp ew) -> putWord8 0xb8 >> putAsW16 ew
MOV (RegOp BX) (ImmOp ew) -> putWord8 0xbb >> putAsW16 ew
MOV (RegOp CX) (ImmOp ew) -> putWord8 0xb9 >> putAsW16 ew
-- MOV (RegOp DX) (ImmOp ew) -> putWord8 >> putEitherW ew
MOV (RegOp AH) (ImmOp ew) -> putWord8 0xb4 >> putAsW8 ew
MOV (RegOp AL) (ImmOp ew) -> putWord8 0xb0 >> putAsW8 ew
Expand Down Expand Up @@ -95,7 +95,7 @@ trans labelMap instrLoc = \case

putAsW8 :: Either Word8 Word16 -> Put =
putWord8 . either id fromIntegral
treatAsW16 :: Either Word8 Word16 -> Put =
putAsW16 :: Either Word8 Word16 -> Put =
putWord16le . either fromIntegral id

firstPass :: [Statement] -> ProgramInfo
Expand Down

0 comments on commit b810d2a

Please sign in to comment.