1 /* insns.h header file for insns.c
3 * The Netwide Assembler is copyright (C) 1996 Simon Tatham and
4 * Julian Hall. All rights reserved. The software is
5 * redistributable under the licence given in the file "Licence"
6 * distributed in the NASM archive.
13 int opcode
; /* the token, passed from "parser.c" */
14 int operands
; /* number of operands */
15 long opd
[3]; /* bit flags for operand types */
16 char *code
; /* the code it assembles to */
17 int flags
; /* some flags */
21 * Instruction template flags. These specify which processor
22 * targets the instruction is eligible for, whether it is
23 * privileged or undocumented, and also specify extra error
24 * checking on the matching of the instruction.
26 * IF_SM stands for Size Match: any operand whose size is not
27 * explicitly specified by the template is `really' intended to be
28 * the same size as the first size-specified operand.
29 * Non-specification is tolerated in the input instruction, but
30 * _wrong_ specification is not.
32 * IF_SM2 invokes Size Match on only the first _two_ operands, for
33 * three-operand instructions such as SHLD: it implies that the
34 * first two operands must match in size, but that the third is
35 * required to be _unspecified_.
37 * IF_SB invokes Size Byte: operands with unspecified size in the
38 * template are really bytes, and so no non-byte specification in
39 * the input instruction will be tolerated.
41 * IF_SD similarly invokes Size Doubleword.
43 * (The default state if neither IF_SM nor IF_SM2 is specified is
44 * that any operand with unspecified size in the template is
45 * required to have unspecified size in the instruction too...)
48 #define IF_SM 0x0001 /* size match */
49 #define IF_SM2 0x0002 /* size match first two operands */
50 #define IF_SB 0x0004 /* unsized operands can't be non-byte */
51 #define IF_SD 0x0008 /* unsized operands can't be nondword */
52 #define IF_8086 0x0000 /* 8086 instruction */
53 #define IF_186 0x0010 /* 186+ instruction */
54 #define IF_286 0x0020 /* 286+ instruction */
55 #define IF_386 0x0030 /* 386+ instruction */
56 #define IF_486 0x0040 /* 486+ instruction */
57 #define IF_PENT 0x0050 /* Pentium instruction */
58 #define IF_P6 0x0060 /* P6 instruction */
59 #define IF_PMASK 0x00F0 /* the mask for processor types */
60 #define IF_PRIV 0x0100 /* it's a privileged instruction */
61 #define IF_UNDOC 0x0200 /* it's an undocumented instruction */
62 #define IF_FPU 0x0400 /* it's an FPU instruction */
63 #define IF_MMX 0x0800 /* it's an MMX instruction */
64 #define IF_ND 0x1000 /* ignore this in the disassembler */