From: Julian Seward Date: Thu, 20 Jan 2005 17:57:55 +0000 (+0000) Subject: Program for making bootstrap .orig files from 'as -a' output. X-Git-Tag: svn/VALGRIND_3_0_1^2~606 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=94d5d6cb5ec25f72eb6830dd5d4d484ab8cbba2e;p=thirdparty%2Fvalgrind.git Program for making bootstrap .orig files from 'as -a' output. git-svn-id: svn://svn.valgrind.org/vex/trunk@728 --- diff --git a/VEX/orig_amd64/Main.hs b/VEX/orig_amd64/Main.hs new file mode 100644 index 0000000000..70925a9456 --- /dev/null +++ b/VEX/orig_amd64/Main.hs @@ -0,0 +1,29 @@ + +module Main where + +main + = do x1 <- readFile "sorted3.txt" + let x2 = lines x1 + x3 = zip [1 ..] x2 + x4 = concat (map qq x3) + --putStr x4 + writeFile "test1.orig" x4 + + +qq :: (Int, String) -> String +qq (n, s0) + = let ws = words s0 + bytes = head ws + rest = unwords (tail ws) + bytes2 = foo bytes + in + unlines [ + "", + rest, + ". " ++ show n ++ " 0x12345678 " ++ show (1 + (length bytes `div` 2)), + ". " ++ bytes2 ++ "C3" + ] + + +foo [] = [] +foo (x:y:rest) = x:y:' ':foo rest