X86_types
module BV = Bap.Std.Bitvector
type binopf = Bap.Std.Exp.t -> Bap.Std.Exp.t -> Bap.Std.Exp.t
type operand =
| Oreg of int
| Ovec of int
| Oseg of int
| Oaddr of Bap.Std.Exp.t
| Oimm of Bap.Std.addr
module Pcmpstr : sig ... end
See section 4.1 of the Intel® 64 and IA-32 Architectures Software Developer’s Manual, Volumes 2A & 2B: Instruction Set Reference (order numbers 253666 and 253667)
type offsetinfo = {
offlen : Bap.Std.typ;
offtyp : Bap.Std.typ;
offop : operand;
offsrcoffset : int;
offdstoffset : int;
}
type cast_type = Bap.Std.cast
type opcode =
| Bswap of Bap.Std.typ * operand
| Retn of (Bap.Std.typ * operand) option * bool
bytes to release, far/near ret
*)| Nop
| Mov of Bap.Std.typ * operand * operand * Bap.Std.Exp.t option
dst, src, condition
*)| Movs of Bap.Std.typ
| Movzx of Bap.Std.typ * operand * Bap.Std.typ * operand
dsttyp, dst, srctyp, src
*)| Movsx of Bap.Std.typ * operand * Bap.Std.typ * operand
dsttyp, dst, srctyp, src
*)| Movdq of Bap.Std.typ * operand * Bap.Std.typ * operand * bool
dst type, dst op, src type, src op, aligned
*)| Movoffset of Bap.Std.typ * operand * offsetinfo list
dest type, dest, (src copy length, src type, src, src src offset, src dest offset)*
*)| Lea of Bap.Std.typ * operand * Bap.Std.Exp.t
| Call of operand * Bap.Std.addr
addr is RA
*)| Shift of Bap.Std.binop * Bap.Std.typ * operand * operand
| Shiftd of Bap.Std.binop * Bap.Std.typ * operand * operand * operand
| Rotate of Bap.Std.binop * Bap.Std.typ * operand * operand * bool
left or right, type, src/dest op, shift op, use carry flag
*)| Bt of Bap.Std.typ * operand * operand
| Bs of Bap.Std.typ * operand * operand * direction
| Jump of jumptarget
| Jcc of jumptarget * Bap.Std.Exp.t
| Setcc of Bap.Std.typ * operand * Bap.Std.Exp.t
| Hlt
| Cmps of Bap.Std.typ
| Scas of Bap.Std.typ
| Stos of Bap.Std.typ
| Push of Bap.Std.typ * operand
| Pop of Bap.Std.typ * operand
| Pushf of Bap.Std.typ
| Popf of Bap.Std.typ
| Popcnt of Bap.Std.typ * operand * operand
size, src, dest
*)| Sahf
| Lahf
| Add of Bap.Std.typ * operand * operand
| Adc of Bap.Std.typ * operand * operand
| Inc of Bap.Std.typ * operand
| Dec of Bap.Std.typ * operand
| Sub of Bap.Std.typ * operand * operand
| Sbb of Bap.Std.typ * operand * operand
| Cmp of Bap.Std.typ * operand * operand
| Cmpxchg of Bap.Std.typ * operand * operand
| Cmpxchg8b of operand
| Xadd of Bap.Std.typ * operand * operand
| Xchg of Bap.Std.typ * operand * operand
| And of Bap.Std.typ * operand * operand
| Or of Bap.Std.typ * operand * operand
| Xor of Bap.Std.typ * operand * operand
| Test of Bap.Std.typ * operand * operand
| Ptest of Bap.Std.typ * operand * operand
| Not of Bap.Std.typ * operand
| Neg of Bap.Std.typ * operand
| Mul of Bap.Std.typ * operand
typ, src
*)| Imul of Bap.Std.typ * bool * operand * operand * operand
typ, (true if one operand form, dst operand), src1, src2
*)| Div of Bap.Std.typ * operand
typ, src
*)| Idiv of Bap.Std.typ * operand
typ, src
*)| Cld
| Rdtsc
| Cpuid
| Xgetbv
| Stmxcsr of operand
| Ldmxcsr of operand
| Fnstcw of operand
| Fldcw of operand
| Fld of operand
| Fst of operand * bool
| Punpck of Bap.Std.typ
* Bap.Std.typ
* order
* operand
* operand
* operand option
dest size, element size, low/high elements, dest, src, optional VEX src
*)| Ppackedbinop of Bap.Std.typ
* Bap.Std.typ
* binopf
* string
* operand
* operand
* operand option
Perform a generic packed binary operation. dest size, element size, binop, assembly string, dest, src, optional VEX src
*)| Pbinop of Bap.Std.typ * binopf * string * operand * operand * operand option
| Pmov of Bap.Std.typ
* Bap.Std.typ
* Bap.Std.typ
* operand
* operand
* cast_type
* string
Packed move. dest size, dest elt size, src elt size, dest, src, ext(signed/zero), name
*)| Pmovmskb of Bap.Std.typ * operand * operand
| Pcmp of Bap.Std.typ
* Bap.Std.typ
* Bap.Std.binop
* string
* operand
* operand
* operand option
| Palignr of Bap.Std.typ * operand * operand * operand option * operand
| Pcmpstr of Bap.Std.typ
* operand
* operand
* operand
* Pcmpstr.imm8cb
* Pcmpstr.pcmpinfo
| Pshufb of Bap.Std.typ * operand * operand * operand option
| Pshufd of Bap.Std.typ * operand * operand * operand option * operand
| Leave of Bap.Std.typ
| Interrupt of operand
| Interrupt3
Trap to debugger
*)| Sysenter
| Syscall
type rex = {
rex_w : bool;
Bit 3: 1 = 64-bit operand size
*)rex_r : bool;
Bit 2: Extension of ModR/M reg field
*)rex_x : bool;
Bit 1: Extension of SIB index field
*)rex_b : bool;
Bit 0: Extension of ModR/M r/m field, SIB base field, or opcode reg field
*)}
See Table 2-4: REX Prefix Fields.
type vex = {
vex_nr : bool;
inverted rex_r bit
*)vex_nx : bool;
inverted rex_x bit
*)vex_nb : bool;
inverted rex_b bit
*)vex_map_select : int;
Specifies the opcode map to use
*)vex_we : bool;
For int instructions, equivalent to rex.w. For non-int instructions, opcode extension bit.
*)vex_v : int;
additional instruction operand (XMM or YMM register)
*)vex_l : bool;
0 = 128-bit operands (xmm), 1 = 256-bit vector operands (ymm)
*)vex_pp : int;
Specifies mandatory prefix (0=none, 1=pref_opsize 2=repz 3=repnz)
*)}
type prefix = {
addrsize : Bap.Std.typ;
opsize : Bap.Std.typ;
General operand size
*)bopsize : Bap.Std.typ;
Operand size that defaults to machine size (e.g. for pop)
*)mopsize : Bap.Std.typ;
Multi-scalar operand size
*)repeat : bool;
nrepeat : bool;
addrsize_override : bool;
opsize_override : bool;
rex : rex option;
vex : vex option;
r_extend : int;
extended r bit
*)rm_extend : int;
extended rm bit or sib base
*)sib_extend : int;
extended sib index bit
*)}