26 lines
751 B
OCaml
26 lines
751 B
OCaml
module type Annot_type = sig
|
|
type instr_annot_t
|
|
end
|
|
|
|
module S (Annot: Annot_type) = struct
|
|
(** A memory address *)
|
|
type addr_t = int
|
|
|
|
(** A single asm instruction *)
|
|
type asm_instr_t = {
|
|
instr_addr: addr_t; (** Memory location of this instruction *)
|
|
instr_bytes: Bytes.t; (** Binary representation of the instruction *)
|
|
instr_asm: string; (** Asm for the instruction (eg `movq …`) *)
|
|
instr_annot: Annot.instr_annot_t; (** User-defined annotation *)
|
|
}
|
|
type asm_t = asm_instr_t list
|
|
type asm_sub_t = {
|
|
sub_section: string;
|
|
sub_name: string;
|
|
sub_addr: addr_t;
|
|
sub_asm: asm_t;
|
|
}
|
|
type asm_info_t = asm_sub_t list
|
|
end
|
|
|
|
module NoAnnot = S(struct type instr_annot_t = unit end)
|