/* insns.h header file for insns.c * * The Netwide Assembler is copyright (C) 1996 Simon Tatham and * Julian Hall. All rights reserved. The software is * redistributable under the license given in the file "LICENSE" * distributed in the NASM archive. */ #ifndef NASM_INSNS_H #define NASM_INSNS_H #include "nasm.h" #include "tokens.h" #include "iflag.h" /* if changed, ITEMPLATE_END should be also changed accordingly */ struct itemplate { … }; /* Use this helper to test instruction template flags */ static inline bool itemp_has(const struct itemplate *itemp, unsigned int bit) { … } /* Disassembler table structure */ /* * If n == -1, then p points to another table of 256 * struct disasm_index, otherwise p points to a list of n * struct itemplates to consider. */ struct disasm_index { … }; /* Tables for the assembler and disassembler, respectively */ extern const struct itemplate * const nasm_instructions[]; extern const struct disasm_index itable[256]; extern const struct disasm_index * const itable_vex[NASM_VEX_CLASSES][32][4]; /* Common table for the byte codes */ extern const uint8_t nasm_bytecodes[]; /* * this define is used to signify the end of an itemplate */ #define ITEMPLATE_END … /* * Pseudo-op tests */ /* DB-type instruction (DB, DW, ...) */ static inline bool const_func opcode_is_db(enum opcode opcode) { … } /* RESB-type instruction (RESB, RESW, ...) */ static inline bool const_func opcode_is_resb(enum opcode opcode) { … } /* Width of Dx and RESx instructions */ /* * initialized data bytes length from opcode */ static inline int const_func db_bytes(enum opcode opcode) { … } /* * Uninitialized data bytes length from opcode */ static inline int const_func resb_bytes(enum opcode opcode) { … } #endif /* NASM_INSNS_H */