harpy

Runtime code generation for x86 machine code

https://github.com/mgrabmueller/harpy

Latest on Hackage:0.6.0.2

This package is not currently in any snapshots. If you're interested in using it, we recommend adding it to Stackage Nightly. Doing so will make builds more reliable, and allow stackage.org to host generated Haddocks.

The package contains the following components:

  • An x86 assembler. We provide both low-level code generation in module Harpy.X86CodeGen as well as a (slightly) higher-level implementation in module Harpy.X86Assembler, which figures out addressing modes based on an instruction's operand types.

  • An x86 disassembler which knows most of the opcodes available on modern x86 processors and can display its output both in the style used in Intel documents an in AT&T style, like the GNU tools. The disassembler can be found in module Harpy.X86Disassembler. The disassembler is re-exported from the disassembler package for compatibility with earlier Harpy releases.

  • Some abstractions over the abovementioned code generation modules, such as automatic label management and code generation combinators (for if-then-else statements, while-loops, functions) (module Harpy.X86CGCombinators).

  • All the above modules use the code generation monad defined in module Harpy.CodeGenMonad.