Adds `.8byte` and `.4byte`.
authorMoritz Angermann <moritz.angermann@gmail.com>
Mon, 5 Mar 2018 01:49:26 +0000 (09:49 +0800)
committerMoritz Angermann <moritz.angermann@gmail.com>
Mon, 5 Mar 2018 01:49:26 +0000 (09:49 +0800)
ATTParser.hs

index 7dfda46..51428b9 100644 (file)
@@ -54,14 +54,21 @@ preprocess :: String -> [Inst]
 preprocess [] = []
 preprocess ('\t':attr) = let (h, t) = break isSpace attr
                          in case h:words' (=='\t') t of
+                         -- 8 byte values
                          (".quad":x:_) | isNumber (w x) -> [Quad $ read (w x)]
                                        | otherwise      -> [Ref  $ (w x)]
                          (".xword":x:_)| isNumber (w x) -> [Quad $ read (w x)]
                                        | otherwise      -> [Ref  $ (w x)]
+                         (".8byte":x:_)| isNumber (w x) -> [Quad $ read (w x)]
+                                       | otherwise      -> [Ref  $ (w x)]
+                         -- 4 byte values
                          (".long":x:_) | isNumber (w x) -> [Long $ read (w x)]
                                        | otherwise      -> [Ref  $ (w x)]
                          (".word":x:_) | isNumber (w x) -> [Long $ read (w x)]
                                        | otherwise      -> [Ref  $ (w x)]
+                         (".4byte":x:_)| isNumber (w x) -> [Long $ read (w x)]
+                                       | otherwise      -> [Ref  $ (w x)]
+
                          (".space":x:_)| (w x) == "4"   -> [Long 0]
                                        | (w x) == "8"   -> [Quad 0]
                          (".ascii":x:_)             -> [Ascii $ read x]