I’ve been looking at generating x86 code and found some interesting links. Here is a declarative description of the instruction set and its encoding in XML:

 

http://ref.x86asm.net/

 

LuaJIT has a really nice C macro library called DynAsm.h that lets you write x86 assembler in your C code in order to generate it:

 

http://luajit.org/dynasm_examples.html

 

Is there anything like this for OCaml?

 

--

Dr Jon Harrop, Flying Frog Consultancy Ltd.

http://www.ffconsultancy.com