aboutsummaryrefslogtreecommitdiff
path: root/X64.hs
diff options
context:
space:
mode:
Diffstat (limited to 'X64.hs')
-rw-r--r--X64.hs10
1 files changed, 5 insertions, 5 deletions
diff --git a/X64.hs b/X64.hs
index 0cbf4fc..c2cbf81 100644
--- a/X64.hs
+++ b/X64.hs
@@ -203,7 +203,7 @@ stringify_only_xmem_brackets (XMem _ mr pair lab off) =
goR1 (Just r) = Just $ stringify (XReg 8 r)
goPair (0, _) = Nothing
goPair (mult, r) = Just $ show mult ++ "*" ++ stringify (XReg 8 r)
- goLab = id
+ goLab = fmap ('$' :)
goOff o | o > 0 = '+' : show o
| o < 0 = show o
| otherwise = ""
@@ -259,11 +259,11 @@ instance Stringifiable Ins where
stringify (CMP a b) = "cmp " ++ stringify a ++ ", " ++ stringify b
stringify (CMPi a b) = "cmp " ++ stringify a ++ ", " ++ stringify b
stringify (SETCC cc a) = "set" ++ stringify cc ++ " " ++ stringify a
- stringify (CALL a) = "call " ++ a
+ stringify (CALL a) = "call $" ++ a
stringify (PUSH a) = "push " ++ stringify a
stringify (POP a) = "pop " ++ stringify a
- stringify (JMP s) = "jmp " ++ s
- stringify (JCC cc s) = "j" ++ stringify cc ++ " " ++ s
+ stringify (JMP s) = "jmp $" ++ s
+ stringify (JCC cc s) = "j" ++ stringify cc ++ " $" ++ s
stringify RET = "ret"
stringify INT3 = "int3"
@@ -271,7 +271,7 @@ instance Stringifiable Asm where
stringify (Asm funcs) = intercalate "\n" $ map goF funcs
where
goF :: (String, [Ins]) -> String
- goF (name, inss) = name ++ ":\n" ++ unlines (map (('\t' :) . stringify) inss)
+ goF (name, inss) = "$" ++ name ++ ":\n" ++ unlines (map (('\t' :) . stringify) inss)
xrefGetSize :: XRef -> Int
xrefGetSize (XReg s _) = s