-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Generate MASM code from haskell -- -- Please see README.md @package MASMGen @version 0.4.0.0 module Language.MASMGen.Types class Def a def :: Def a => a data MASM MASM :: MASMMode -> [String] -> [MASMInclude] -> MASMProgM () -> MASM [masmProgMode] :: MASM -> MASMMode [masmProgOptions] :: MASM -> [String] [masmInclude] :: MASM -> [MASMInclude] [masmProg] :: MASM -> MASMProgM () data Lit IntLit :: Word8 -> Lit Lits :: [Lit] -> Lit type Addr = Word16 type Scale = Int type Displacement = Int data Operand Imm :: Word16 -> Operand Direct :: Addr -> Operand Reg :: a -> Operand RegIndirect :: a -> Operand RegIndex :: a -> Displacement -> Operand RegIndexScale :: a -> a -> Scale -> Displacement -> Operand VarAddr :: String -> Operand data OpClass Pointer :: OpClass Register :: RegClass -> OpClass Immediate :: OpClass class OperandClass a operandClass :: OperandClass a => a -> OpClass data MASMMode Mode386 :: MASMMode Mode486 :: MASMMode Mode586 :: MASMMode Mode686 :: MASMMode data Reg32 EAX :: Reg32 EBX :: Reg32 ECX :: Reg32 EDX :: Reg32 ESI :: Reg32 EDI :: Reg32 ESP :: Reg32 EBP :: Reg32 data Reg16 AX :: Reg16 BX :: Reg16 CX :: Reg16 DX :: Reg16 SI :: Reg16 DI :: Reg16 SP :: Reg16 BP :: Reg16 data Reg8 AH :: Reg8 AL :: Reg8 BH :: Reg8 BL :: Reg8 CH :: Reg8 CL :: Reg8 DH :: Reg8 DL :: Reg8 SPL :: Reg8 BPL :: Reg8 SIL :: Reg8 DIL :: Reg8 data RegXMM XMM0 :: RegXMM XMM1 :: RegXMM XMM2 :: RegXMM XMM3 :: RegXMM XMM4 :: RegXMM XMM5 :: RegXMM XMM6 :: RegXMM XMM7 :: RegXMM XMM8 :: RegXMM XMM9 :: RegXMM XMM10 :: RegXMM XMM11 :: RegXMM XMM12 :: RegXMM XMM13 :: RegXMM XMM14 :: RegXMM XMM15 :: RegXMM data RegClass Reg32 :: RegClass Reg16 :: RegClass Reg8 :: RegClass RegXMM :: RegClass class Show a => Reg a where showReg = show showReg :: Reg a => a -> String regClass :: Reg a => a -> RegClass data MASMInclude MASMInclude :: String -> MASMInclude MASMIncludeLib :: String -> MASMInclude data MASMType DB :: MASMType DW :: MASMType DD :: MASMType Ptr :: MASMType -> MASMType type MASMVar = (MASMType, [Word8]) type MASMVarMap = Map String MASMVar data CallingConvention Default :: CallingConvention Cdecl :: CallingConvention FastCall :: CallingConvention StdCall :: CallingConvention data MASMInstr MASMAdd :: (Maybe MASMType) -> Operand -> Operand -> MASMInstr MASMSub :: (Maybe MASMType) -> Operand -> Operand -> MASMInstr MASMMul :: (Maybe MASMType) -> Operand -> Operand -> MASMInstr MASMDiv :: (Maybe MASMType) -> Operand -> Operand -> MASMInstr MASMMov :: (Maybe MASMType) -> Operand -> Operand -> MASMInstr MASMInc :: (Maybe MASMType) -> Operand -> MASMInstr MASMDec :: (Maybe MASMType) -> Operand -> MASMInstr MASMPush :: (Maybe MASMType) -> Operand -> MASMInstr MASMPop :: (Maybe MASMType) -> Operand -> MASMInstr MASMFuncCall :: String -> CallingConvention -> [FuncArg] -> MASMInstr MASMGoto :: String -> MASMInstr MASMLabel :: String -> MASMInstr MASMComment :: String -> MASMInstr type FuncArg = Operand data MASMFunc MASMFunc :: String -> [MASMInstr] -> MASMFunc [funcName] :: MASMFunc -> String [instrs] :: MASMFunc -> [MASMInstr] type MASMFuncM a = State MASMFunc a type MASMProgM a = State MASMProg a data MASMTopLevel Func :: MASMFunc -> MASMTopLevel data MASMProg MASMProg :: MASMVarMap -> [MASMTopLevel] -> MASMProg [globalVarMap] :: MASMProg -> MASMVarMap [funcs] :: MASMProg -> [MASMTopLevel] data MASMOutput MASMOutput :: String -> MASMOutput MASMOutputNoIndent :: String -> MASMOutput Indent :: MASMOutput Dedent :: MASMOutput NewLine :: MASMOutput type UntypedMASMInstrSinCon = Operand -> MASMInstr type UntypedMASMInstrBinCon = Operand -> Operand -> MASMInstr type TypedMASMInstrSinCon = (Maybe MASMType) -> Operand -> MASMInstr type TypedMASMInstrBinCon = (Maybe MASMType) -> Operand -> Operand -> MASMInstr instance GHC.Show.Show Language.MASMGen.Types.RegXMM instance GHC.Show.Show Language.MASMGen.Types.Reg8 instance GHC.Show.Show Language.MASMGen.Types.Reg16 instance GHC.Show.Show Language.MASMGen.Types.Reg32 instance Language.MASMGen.Types.Def Language.MASMGen.Types.MASM instance Language.MASMGen.Types.OperandClass Language.MASMGen.Types.Operand instance GHC.Show.Show Language.MASMGen.Types.Operand instance Language.MASMGen.Types.Reg Language.MASMGen.Types.Reg32 instance Language.MASMGen.Types.Reg Language.MASMGen.Types.Reg16 instance Language.MASMGen.Types.Reg Language.MASMGen.Types.Reg8 instance Language.MASMGen.Types.Reg Language.MASMGen.Types.RegXMM instance GHC.Show.Show Language.MASMGen.Types.MASMType module Language.MASMGen.Core mkFunc :: String -> MASMFuncM () -> MASMProgM () initFuncState :: String -> MASMFunc initProgState :: MASMProg section :: String -> Writer [MASMOutput] () output :: [MASMOutput] -> [String] produceAsm :: MASM -> Writer [MASMOutput] () produceAsmOptions :: [String] -> Writer [MASMOutput] () produceAsmInclude :: [MASMInclude] -> Writer [MASMOutput] () produceAsmProg :: MASMProgM () -> Writer [MASMOutput] () produceAsmGlobalVarMap :: MASMVarMap -> Writer [MASMOutput] () produceAsmFuncs :: [MASMTopLevel] -> Writer [MASMOutput] () printShowableInstr :: MASMInstr -> Writer [MASMOutput] () add :: Operand -> Operand -> MASMFuncM () addb :: Operand -> Operand -> MASMFuncM () addw :: Operand -> Operand -> MASMFuncM () addl :: Operand -> Operand -> MASMFuncM () sub :: Operand -> Operand -> MASMFuncM () subb :: Operand -> Operand -> MASMFuncM () subw :: Operand -> Operand -> MASMFuncM () subl :: Operand -> Operand -> MASMFuncM () imul :: Operand -> Operand -> MASMFuncM () idiv :: Operand -> Operand -> MASMFuncM () inc :: Operand -> MASMFuncM () dec :: Operand -> MASMFuncM () mov :: Operand -> Operand -> MASMFuncM () movb :: Operand -> Operand -> MASMFuncM () movw :: Operand -> Operand -> MASMFuncM () movl :: Operand -> Operand -> MASMFuncM () goto :: String -> MASMFuncM () push :: Operand -> MASMFuncM () pushl :: Operand -> MASMFuncM () pop :: Operand -> MASMFuncM () popl :: Operand -> MASMFuncM () label :: String -> MASMFuncM () comment :: String -> MASMFuncM ()