6 data DT_State = NoState | InData | InText deriving (Show,Eq)
10 type ValueToParse = String
16 DTF_Data Address Value Code Label Comment | -- 0;...
17 DTF_Instr Address Value Code Label Comment | -- 1;...
18 DTF_Comment Comment | -- 2;...
19 DTF_Label Label Comment Address | -- 3;...
20 -- types for intern processing
21 DTF_InstrToParse Address ValueToParse Code Label Comment |
22 DTF_SectionToDet Address Value Code Label Comment |
26 instance Show (DTF) where
27 showsPrec n = showsDTF
29 showsDTF :: DTF -> ShowS
30 showsDTF (DTF_Data a v c l s) = (++) (datins "0" a v c l s)
31 showsDTF (DTF_Instr a v c l s) = (++) (datins "1" a v c l s)
32 showsDTF (DTF_Comment c) = (++) (printf "2;%s\n" c)
33 showsDTF (DTF_Label l c _) = (++) (printf "3;%s;%s\n" l c)
34 showsDTF (DTF_InstrToParse a v c l s) = (++) (printf "itp;%08x;%s;%s;%s;%s\n" a v c l s)
35 showsDTF (DTF_SectionToDet a v c l s) = (++) (datins "std" a v c l s)
36 showsDTF (DTF_Org a) = (++) (printf "org;%08x\n" a)
37 showsDTF (DTF_State s) = (++) (printf "sta;%s\n" (show s))
39 datins :: String -> Address -> Value -> Code -> Label -> Comment -> String
40 datins = printf "%s;%08x;%08x;%s;%s;%s\n"