Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
OutputGeneration.NASM.NASM
Description
Synopsis
- data NASM = NASM {
- nasm_externals :: Set String
- nasm_globals :: Set String
- nasm_sections :: [NASM_Section]
- nasm_footer :: [String]
- data NASM_Label
- data NASM_Section
- type Annot = [(Word64, NASM_Label, Word64)]
- data NASM_TextSection = NASM_TextSection {
- nasm_function_name :: String
- nasm_blocks :: [(Int, [NASM_Line])]
- nasm_cfg :: IntMap IntSet
- data NASM_Line
- data NASM_Instruction = NASM_Instruction {}
- type NASM_SizeDir = (Int, Bool)
- data NASM_Address
- data NASM_Address_Computation = NASM_Address_Computation {}
- data NASM_DataEntry
- data NASM_DataSection = NASM_DataSection {}
Documentation
NASM contains external symbols, sections, and a footer
Constructors
NASM | |
Fields
|
Instances
Generic NASM Source # | |
Serialize NASM Source # | |
type Rep NASM Source # | |
Defined in OutputGeneration.NASM.NASM type Rep NASM = D1 ('MetaData "NASM" "OutputGeneration.NASM.NASM" "foxdec-0.1.0.0-DGuc5MMkhbvOBLAebyTd5" 'False) (C1 ('MetaCons "NASM" 'PrefixI 'True) ((S1 ('MetaSel ('Just "nasm_externals") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Set String)) :*: S1 ('MetaSel ('Just "nasm_globals") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Set String))) :*: (S1 ('MetaSel ('Just "nasm_sections") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [NASM_Section]) :*: S1 ('MetaSel ('Just "nasm_footer") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [String])))) |
data NASM_Label Source #
A NASM label is either a string, or a macro. The latter is used when referring to addresses within data sections. For example:
Macro "" ".data" 0x4000 0x23
refers to segment "", and the section ".data" that starts at immediate address 0x4000. So the real adress was 0x4023.
Constructors
Label Word64 String | Normal label |
Macro String String Word64 Word64 | Macro into data section (segment, section, a0, offset) |
Instances
data NASM_Section Source #
A NASM section is either a NASM text section or NASM data section
Constructors
NASM_Section_Text NASM_TextSection | |
NASM_Section_Data [NASM_DataSection] |
Instances
Generic NASM_Section Source # | |
Defined in OutputGeneration.NASM.NASM Associated Types type Rep NASM_Section :: Type -> Type # | |
Serialize NASM_Section Source # | |
Defined in OutputGeneration.NASM.NASM | |
type Rep NASM_Section Source # | |
Defined in OutputGeneration.NASM.NASM type Rep NASM_Section = D1 ('MetaData "NASM_Section" "OutputGeneration.NASM.NASM" "foxdec-0.1.0.0-DGuc5MMkhbvOBLAebyTd5" 'False) (C1 ('MetaCons "NASM_Section_Text" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 NASM_TextSection)) :+: C1 ('MetaCons "NASM_Section_Data" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [NASM_DataSection]))) |
type Annot = [(Word64, NASM_Label, Word64)] Source #
An annotation consists of an address that is being symbolized to a label and an offset. The offset will often be 0. For example: 0x1016 --> L1000_2 0x4028 --> L_.bss_0x4020 + 0x8 Annotations translate to NASM comments, and have no effect on the actual NASM itself.
data NASM_TextSection Source #
A NASM text section contains a name and an **ordered** list of basic blocks. Each basic block has an ID and a list of lines.
Constructors
NASM_TextSection | |
Fields
|
Instances
A NASM line is either a comment, an instruction or a label
Constructors
NASM_Comment Int String | A comment with an indentation level (number of spaces) |
NASM_Line NASM_Instruction | An instruction with an annotation |
NASM_Label NASM_Label | A label |
Instances
Generic NASM_Line Source # | |
Show NASM_Line Source # | |
Serialize NASM_Line Source # | |
Eq NASM_Line Source # | |
type Rep NASM_Line Source # | |
Defined in OutputGeneration.NASM.NASM type Rep NASM_Line = D1 ('MetaData "NASM_Line" "OutputGeneration.NASM.NASM" "foxdec-0.1.0.0-DGuc5MMkhbvOBLAebyTd5" 'False) (C1 ('MetaCons "NASM_Comment" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 String)) :+: (C1 ('MetaCons "NASM_Line" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 NASM_Instruction)) :+: C1 ('MetaCons "NASM_Label" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 NASM_Label)))) |
data NASM_Instruction Source #
An instruction consists of a prefix, an opcode, a list of operands, a comment (possibly empty) and an annotation (possibly empty).
Constructors
NASM_Instruction | |
Fields
|
Instances
type NASM_SizeDir = (Int, Bool) Source #
A size directive for a memory operand in bytes. For example (4,True) is the size directive for a 4-byte memory operand.
It can be False
to indicate that the operand should not be rendered (e.g, in case of an LEA instruction).
data NASM_Address Source #
An address can either be a computation or some symbol.
Constructors
NASM_Addr_Compute NASM_Address_Computation | |
NASM_Addr_Symbol Symbol | |
NASM_Addr_Label NASM_Label (Maybe Word64) | |
NASM_JumpTarget ResolvedJumpTarget |
Instances
data NASM_Address_Computation Source #
An address computation within an operand. The computation is: segment + [base + index*scale + disp]
Constructors
NASM_Address_Computation | |
Fields
|
Instances
data NASM_DataEntry Source #
A data section consists of a list of data section entries. Each DataEntry stores its address and a value.
Constructors
DataEntry_Byte Word64 Word8 | A single byte |
DataEntry_String Word64 [Word8] | A string of characters (Word8) |
DataEntry_Pointer Word64 (NASM_Address, Annot) | A pointer (a label or external symbol) |
DataEntry_BSS Int | A BSS section with a given size in bytes |
Instances
data NASM_DataSection Source #
A data section then consists of:
Constructors
NASM_DataSection | |
Fields
|