ocaml-base-compiler

Official release 4.12.1
IN THIS PACKAGE
Module X86_proc

Helpers for textual emitters

val string_of_reg8l : X86_ast.reg64 -> string
val string_of_reg8h : X86_ast.reg8h -> string
val string_of_reg16 : X86_ast.reg64 -> string
val string_of_reg32 : X86_ast.reg64 -> string
val string_of_reg64 : X86_ast.reg64 -> string
val string_of_registerf : X86_ast.registerf -> string
val string_of_string_literal : string -> string
val string_of_condition : X86_ast.condition -> string
val string_of_symbol : string -> string -> string
val string_of_rounding : X86_ast.rounding -> string
val buf_bytes_directive : Buffer.t -> string -> string -> unit

Buffer of assembly code

val emit : X86_ast.instruction -> unit
val directive : X86_ast.asm_line -> unit
val reset_asm_code : unit -> unit

Code emission

val generate_code : ( X86_ast.asm_line list -> unit ) option -> unit

Post-process the stream of instructions. Dump it (using the provided syntax emitter) in a file (if provided) and compile it with an internal assembler (if registered through register_internal_assembler).

val assemble_file : string -> string -> int

Generate an object file corresponding to the last call to generate_code. An internal assembler is used if available (and the input file is ignored). Otherwise, the source asm file with an external assembler.

System detection

type system =
| S_macosx
| S_gnu
| S_cygwin
| S_solaris
| S_win32
| S_linux_elf
| S_bsd_elf
| S_beos
| S_mingw
| S_win64
| S_linux
| S_mingw64
| S_unknown
val system : system
val masm : bool
val windows : bool
val use_plt : bool

Whether calls need to go via the PLT.

Support for plumbing a binary code emitter

val register_internal_assembler : ( X86_ast.asm_program -> string -> unit ) -> unit