ndisasm: Match vector length with EVEX.b set
[platform/upstream/nasm.git] / insns.h
1 /* insns.h   header file for insns.c
2  *
3  * The Netwide Assembler is copyright (C) 1996 Simon Tatham and
4  * Julian Hall. All rights reserved. The software is
5  * redistributable under the license given in the file "LICENSE"
6  * distributed in the NASM archive.
7  */
8
9 #ifndef NASM_INSNS_H
10 #define NASM_INSNS_H
11
12 #include "nasm.h"
13 #include "tokens.h"
14 #include "iflag.h"
15
16 /* if changed, ITEMPLATE_END should be also changed accordingly */
17 struct itemplate {
18     enum opcode     opcode;             /* the token, passed from "parser.c" */
19     int             operands;           /* number of operands */
20     opflags_t       opd[MAX_OPERANDS];  /* bit flags for operand types */
21     decoflags_t     deco[MAX_OPERANDS]; /* bit flags for operand decorators */
22     const uint8_t   *code;              /* the code it assembles to */
23     uint32_t        iflag_idx;          /* some flags referenced by index */
24 };
25
26 /* Disassembler table structure */
27
28 /*
29  * If n == -1, then p points to another table of 256
30  * struct disasm_index, otherwise p points to a list of n
31  * struct itemplates to consider.
32  */
33 struct disasm_index {
34     const void *p;
35     int n;
36 };
37
38 /* Tables for the assembler and disassembler, respectively */
39 extern const struct itemplate * const nasm_instructions[];
40 extern const struct disasm_index itable[256];
41 extern const struct disasm_index * const itable_vex[NASM_VEX_CLASSES][32][4];
42
43 /* Common table for the byte codes */
44 extern const uint8_t nasm_bytecodes[];
45
46 /*
47  * this define is used to signify the end of an itemplate
48  */
49 #define ITEMPLATE_END {-1,-1,{-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1},NULL,0}
50
51 #endif /* NASM_INSNS_H */