#	This is the file "instr.key", which says what the operand-list keys
#	mean.

#	Comments are as described in "instr.set".
#	Additionally, a semi-colon allows comments in data lines.

#	Keys may be one or two characters.

#   v1.09: - for D and E: OP_16 changed to OP_1632.
#          - for S8: OP_IMM8 changed to OP_IMMS8.
#          - key L isn't used anymore (was used for 32bit LOOPx).
#   v1.18: - keys rearranged, they are now always 2 hex digits.
#          - ';' comments added
#   lDebug: added movntq, MMX instruction set (51+)

# Usage of the works is permitted provided that this
# instrument is retained with the works, so that any entity
# that uses the works is notified of this instrument.
#
# DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.

00		; Special: Empty operand list, must be first.
01 OP_ALL+OP_AX, OP_ALL+OP_IMM_NOT_EXTEND	; add, adc, and, or, sub, ...
02 OP_X, OPX_MOD_IF_REG_AL_AX_EAX, OP_M_SRC_DST, OP_ALL+OP_RM, \
	OP_ALL+OP_IMM_NOT_EXTEND		; add, adc, and, or, sbb, sub, xor
82 OP_X, OPX_MOD_IF_REG_AL_AX_EAX, OP_M_SRC, OP_ALL+OP_RM, \
	OP_ALL+OP_IMM_NOT_EXTEND		; cmp, test
C2 OP_M_DST, OP_X, OPX_MOD_IF_REG, OP_ALL+OP_RM, \
	OP_ALL+OP_IMM				; mov
03 OP_M_SRC_DST, OP_X, OPX_MOD_IF_REG_AL_AX_EAX, OP_1632+OP_RM, \
	OP_IMMS8_EXTEND				; add, adc, and, or, sub, ...
83 OP_M_SRC, OP_X, OPX_MOD_IF_REG_AL_AX_EAX, OP_1632+OP_RM, \
	OP_IMMS8_EXTEND				; cmp
# C3 OP_M_DST, OP_1632+OP_RM, OP_IMMS8_EXTEND	; unused
04 OP_M_SRC_DST, OP_X, OPX_MODALWAYS_IF_REG, \
	OP_ALL+OP_RM, OP_ALL+OP_R		; add, adc, and, or, sub, ...
84 OP_M_SRC, OP_X, OPX_MODALWAYS_IF_REG, \
	OP_ALL+OP_RM, OP_ALL+OP_R		; cmp, test
C4 OP_M_DST, OP_X, OPX_MOD_IF_MEMOFFS_AND_OTHER_REG_AL_AX_EAX, \
	OP_X, OPX_MODALWAYS_IF_REG, OP_ALL+OP_RM, \
	OP_ALL+OP_R				; mov
05 OP_ALL+OP_R, OP_M_SRC, OP_X, OPX_MOD_IF_REG, \
	OP_ALL+OP_RM				; add, adc, and, or, sub, ...
F5 OP_ALL+OP_R, OP_M_SRC, OP_X, OPX_MOD_IF_MEMOFFS_AND_OTHER_REG_AL_AX_EAX, \
	OP_X, OPX_MOD_IF_REG, OP_ALL+OP_RM	; mov
85 OP_ALL+OP_R, OP_M_SRC_DST, OP_X, OPX_MOD_IF_REG_AX_EAX, \
	OP_X, OPX_MOD_IF_OTHER_REG_AX_EAX, \
	OP_X, OPX_MODALWAYS_IF_REG, \
	OP_ALL+OP_RM				; xchg
06 OP_M_SRC_DST, OP_16+OP_RM, OP_16+OP_R	; arpl
07 OP_1632+OP_R, \
	OP_M_SRC, OP_FAR_M, OP_1632+OP_M	; LxS (lds, les, lss, lfs, lgs)
08 OP_1632+OP_R, OP_M_SRC, OP_1632+OP_RM	; cmovxx, bsf, bsr, imul, lar, lsl
09 OP_32+OP_R_ADD				; bswap
0A OP_M_SRC_DST, OP_1632+OP_RM, OP_1632+OP_R	; btr, bts, btc
8A OP_M_SRC, OP_1632+OP_RM, OP_1632+OP_R	; bt
0B OP_M_SRC_DST, OP_1632+OP_RM, OP_IMM8		; btr, bts, btc
8B OP_M_SRC, OP_1632+OP_RM, OP_IMM8		; bt
0C OP_NEAR, OP_REL1632				; jmp/jcc near
GC OP_STACK_PUSH, OP_NEAR, OP_REL1632		; call near
0D OP_FAR, OP_FARIMM				; jmp seg:ofs
GD OP_STACK_SPECIAL, OP_FAR, OP_FARIMM		; call seg:ofs
F2 OP_FAR_REQUIRED, OP_FAR_OFFSET		; jmp seg:ofs
F3 OP_STACK_SPECIAL, \
	OP_FAR_REQUIRED, OP_FAR_OFFSET		; call seg:ofs
0E OP_FAR_REQUIRED, OP_M_SRC, OP_FAR_M, \
	OP_1632_DEFAULT+OP_M			; jmp far [mem]
GE OP_STACK_SPECIAL, OP_FAR_REQUIRED, \
	OP_M_SRC, OP_FAR_M, OP_1632_DEFAULT+OP_M; call far [mem]
0F OP_M_SRC_DST, OP_M64				; cmpxchg8b
8F OP_M_SRC, OP_M64				; fild
CF OP_M_DST, OP_M64				; fistp
10 OP_M_SRC_DST, OP_ALL+OP_RM			; not, neg
F4 OP_X, OPX_MOD_IF_REG_1632, \
	OP_M_SRC_DST, OP_ALL+OP_RM		; dec, inc
90 OP_M_SRC, OP_ALL+OP_RM			; imul, mul, div, idiv
# D0 OP_M_DST, OP_ALL+OP_RM			; unused?
11 OP_1632+OP_R_ADD				; dec, inc
F1 OP_STACK_PUSH, OP_1632+OP_R_ADD		; push
G1 OP_STACK_POP, OP_1632+OP_R_ADD		; pop
12 OP_STACK_PUSH, OP_16+OP_IMM, OP_IMM8		; enter
# 13 OP_M_SRC_DST, OP_MFLOAT			; unused?
93 OP_M_SRC, OP_MFLOAT				; fld, fsub, fcom, fadd, ...
D3 OP_M_DST, OP_MFLOAT				; fst, fstp
# 14 OP_M_SRC_DST, OP_MDOUBLE			; unused?
94 OP_M_SRC, OP_MDOUBLE				; fld, fsub, fcom, fadd, ...
D4 OP_M_DST, OP_MDOUBLE				; fst, fstp
15 OP_ST, OP_STI				; fdiv, fmul, fcmovxx,...
16 OP_STI, OP_ST				; fadd, fdiv, ...
17 OP_1CHK, OP_STI, OP_ST			; fxxxp
# 18 OP_M_SRC_DST, OP_32+OP_M			; unused?
98 OP_M_SRC, OP_32+OP_M				; fixxx
D8 OP_M_DST, OP_32+OP_M				; fist, fistp
# 19 OP_M_SRC_DST, OP_16+OP_M			; unused?
99 OP_M_SRC, OP_16+OP_M				; fldcw, fixxx
D9 OP_M_DST, OP_16+OP_M				; fist, fistp, fstcw, fstsw
# 1A OP_M_SRC_DST, OP_M80			; unused?
9A OP_M_SRC, OP_M80				; fbld
DA OP_M_DST, OP_M80				; fbstp
1B OP_STI					; fld, fst, ...
1C OP_1CHK, OP_STI				; f[u]comx
# 1D OP_M_SRC_DST, OP_M80			; unused?
9D OP_M_SRC, OP_M80				; fld
DD OP_M_DST, OP_M80				; fstp
1E OP_MXX					; invlpg
# 1E OP_M_SRC_DST, OP_MXX			; unused
9E OP_M_SRC, OP_MXX				; l[g|i]dt, frstor, fldenv
DE OP_M_DST, OP_MXX				; s[g|i]dt, fsave, fstenv
1F OP_16+OP_AX					; fstsw
20 OP_1632+OP_R, OP_M_SRC, OP_1632+OP_RM, \
	OP_IMMS8				; imul
21 OP_1632+OP_R_MOD, OP_1632+OP_R, OP_IMMS8	; imul
22 OP_1632+OP_R, OP_M_SRC, OP_1632+OP_RM, \
	OP_1632+OP_IMM_NOT_EXTEND		; imul
23 OP_1632+OP_R_MOD, OP_1632+OP_R, \
	OP_1632+OP_IMM_NOT_EXTEND		; imul
24 OP_ALL+OP_AX, OP_IMM8			; in al|ax|eax, imm
25 OP_ALL+OP_AX, OP_DX				; in al|ax|eax, dx
26 OP_STACK_SPECIAL, OP_3			; INT 3
27 OP_IMM8					; int xx
Z7 OP_IMM8_OPTIONAL				; aam, aad
28 OP_SHORT, OP_REL8				; jxx, loopxx, jmp short
F6 OP_X, OPX_LOOP_OPTION, OP_SHORT, OP_REL8
# 29 OP_M_SRC_DST, OP_1632+OP_RM		; unused?
A9 OP_STACK_PUSH, OP_M_SRC, OP_X, OPX_MOD_IF_REG, \
	OP_1632_DEFAULT_ASM+OP_RM		; push [mem]
E9 OP_M_DST, OP_1632+OP_RM			; sldt, smsw
# 2A OP_M_SRC_DST, OP_16+OP_RM			; unused?
AA OP_M_SRC, OP_16+OP_RM			; ltr, lldt, lmsw, verr, verw
EA OP_M_DST, OP_16+OP_RM			; str
2B OP_M_ALWAYS_16, OP_M_DST, OP_1632+OP_RM, \
	OP_SEGREG				; mov <reg>|[mem], <segr>
2C OP_M_ALWAYS_16, OP_SEGREG, \
	OP_M_SRC, OP_1632+OP_RM			; mov <segr>, <reg>|[mem]
2D OP_ALL+OP_AX, OP_M_SRC, OP_ALL+OP_MOFFS	; mov al|ax|eax, [mem]
2E OP_M_DST, OP_ALL+OP_MOFFS, OP_ALL+OP_AX	; mov [mem], al|ax|eax
2F OP_8+OP_R_ADD, OP_8+OP_IMM			; mov <reg>, <imm>
30 OP_1632+OP_R_ADD, OP_1632+OP_IMM		; mov <reg>, <imm>
31 OP_1632+OP_R, OP_SHOSIZ, \
	OP_M_SRC, OP_ASM_MOVX, OP_8+OP_RM	; movzx, movsx
32 OP_1632+OP_R, OP_SHOSIZ, \
	OP_M_SRC, OP_ASM_MOVX, OP_16+OP_RM	; movzx, movsx
33 OP_IMM8, OP_ALL+OP_AX			; out imm, al|ax|eax
34 OP_DX, OP_ALL+OP_AX				; out dx,al|ax|eax
35 OP_STACK_POP, OP_M_DST, OP_X, OPX_MOD_IF_REG, \
	OP_1632_DEFAULT_ASM+OP_RM		; pop [mem]
36 OP_STACK_PUSH, OP_SHOSIZ, \
	OP_1632_DEFAULT+OP_IMM_NOT_EXTEND	; push <imm>
37 OP_STACK_PUSH, OP_SHOSIZ, OP_IMMS8		; push byte <imm>
38 OP_M_SRC_DST, OP_ALL+OP_RM, OP_1		; shl, shr, rol, ror, ...
39 OP_M_SRC_DST, OP_ALL+OP_RM, OP_CL		; shl, shr, rol, ror, ...
3A OP_M_SRC_DST, OP_ALL+OP_RM, OP_IMM8_SHIFTROT	; shl, shr, rol, ror, ...
3B OP_16+OP_IMM					; boxcb
G7 OP_STACK_POP, OP_16+OP_IMM			; retn x
G8 OP_STACK_SPECIAL, OP_16+OP_IMM		; retf x
3C OP_M_DST, OP_8+OP_RM				; setxx
3D OP_M_SRC_DST, OP_1632+OP_RM, OP_1632+OP_R, \
	OP_IMM8					; shld, shrd
3E OP_M_SRC_DST, OP_1632+OP_RM, OP_1632+OP_R, \
	OP_CL					; shld, shrd
3F OP_1632+OP_AX, OP_1632+OP_R_ADD		; xchg
40 OP_1632+OP_R_ADD, OP_1632+OP_AX		; xchg
# The next six must be in machine order.
41 OP_ES
42 OP_CS
43 OP_SS
44 OP_DS
45 OP_FS
46 OP_GS
S1 OP_STACK_PUSH, OP_ES
S2 OP_STACK_PUSH, OP_CS
S3 OP_STACK_PUSH, OP_SS
S4 OP_STACK_PUSH, OP_DS
S5 OP_STACK_PUSH, OP_FS
S6 OP_STACK_PUSH, OP_GS
Z1 OP_STACK_POP, OP_ES
# Z2 OP_STACK_POP, OP_CS
Z3 OP_STACK_POP, OP_SS
Z4 OP_STACK_POP, OP_DS
Z5 OP_STACK_POP, OP_FS
Z6 OP_STACK_POP, OP_GS
47 OP_32+OP_R_MOD, OP_CR			; mov <reg>, CRx
48 OP_CR, OP_32+OP_R_MOD			; mov CRx, <reg>
49 OP_32+OP_R_MOD, OP_DR			; mov <reg>,DRx
4A OP_DR, OP_32+OP_R_MOD			; mov DRx, <reg>
4B OP_32+OP_R_MOD, OP_TR			; mov <reg>,TRx
4C OP_TR, OP_32+OP_R_MOD			; mov TRx,<reg>
4D OP_MMX, OP_M_SRC, OP_32+OP_RM		; movd mm,r/m32
4E OP_M_DST, OP_32+OP_RM, OP_MMX		; movd r/m32,mm
4F OP_MMX, OP_M_SRC, OP_64+OP_RM		; movq mm,mm/m64; most MMX instrs
50 OP_M_DST, OP_64+OP_RM, OP_MMX		; movq mm/m64,mm

52 OP_MMX_MOD, OP_IMM8				; psllw,lld,llq,raw,rad,rlw,rld,rlq
#53 OP_64+OP_M, OP_MMX				; SSE	; movntq m64,mm
#54 OP_32+OP_R, OP_MMX_MOD, OP_IMM8		; SSE	; pextrw
#55 OP_MMX, OP_16+OP_RM, OP_IMM8		; SSE	; pinsrw
#56 OP_32+OP_R, OP_MMX_MOD			; SSE	; pmovmskb
#57 OP_MMX, OP_64+OP_RM, OP_IMM8		; SSE	; pshufw
#58 OP_MMX, OP_MMX_MOD				; SSE	; maskmovq
#59 OP_MMX, OP_32+OP_RM, OP_IMM8		; SSE	; pinsrw (nominal r32 specification)
60 OP_1632+OP_R, OP_MXX				; lea
# 61 OP_M_SRC_DST, OP_8+OP_RM, OP_8+OP_IMM	; add, adc, and, or, sbb, sub, xor
# B1 OP_M_SRC, OP_8+OP_RM, OP_8+OP_IMM		; cmp
# F1 OP_M_DST, OP_8+OP_RM, OP_8+OP_IMM		; unused
62 OP_NEAR, OP_M_SRC, OP_1632_DEFAULT+OP_RM	; jmp
GA OP_STACK_PUSH, OP_NEAR, \
	OP_M_SRC, OP_1632_DEFAULT+OP_RM		; call
63 OP_1632+OP_R, \
	OP_M_SRC, OP_DOUBLE_M, OP_1632+OP_M	; bound
64 OP_STACK_SPECIAL, OP_IMM8_INT		; int
65 OP_SHORT, OP_REL8, OP_E_CX			; loopxx
G2 OP_STACK_POP					; popf, retn
G3 OP_STACK_PUSH				; pushf
G9 OP_STACK_SPECIAL				; pusha, popa, retf, iret, leave, into, int3, int1
