2002-04-30 20:51:32 +00:00
|
|
|
/* 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
|
2007-12-29 09:44:23 -05:00
|
|
|
* redistributable under the license given in the file "LICENSE"
|
2002-04-30 20:51:32 +00:00
|
|
|
* distributed in the NASM archive.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef NASM_INSNS_H
|
|
|
|
#define NASM_INSNS_H
|
|
|
|
|
2007-09-17 15:49:30 -07:00
|
|
|
#include "nasm.h"
|
2007-09-24 12:30:54 -07:00
|
|
|
#include "tokens.h"
|
2013-11-09 22:16:11 +04:00
|
|
|
#include "iflag.h"
|
2002-09-12 16:34:06 +00:00
|
|
|
|
2013-08-15 19:01:25 -07:00
|
|
|
/* if changed, ITEMPLATE_END should be also changed accordingly */
|
2002-04-30 20:51:32 +00:00
|
|
|
struct itemplate {
|
2011-07-17 17:52:03 +04:00
|
|
|
enum opcode opcode; /* the token, passed from "parser.c" */
|
|
|
|
int operands; /* number of operands */
|
|
|
|
opflags_t opd[MAX_OPERANDS]; /* bit flags for operand types */
|
2013-08-15 19:01:25 -07:00
|
|
|
decoflags_t deco[MAX_OPERANDS]; /* bit flags for operand decorators */
|
2011-07-17 17:52:03 +04:00
|
|
|
const uint8_t *code; /* the code it assembles to */
|
2013-11-09 22:16:11 +04:00
|
|
|
uint32_t iflag_idx; /* some flags referenced by index */
|
2002-04-30 20:51:32 +00:00
|
|
|
};
|
|
|
|
|
2007-09-18 15:08:20 -07:00
|
|
|
/* Disassembler table structure */
|
2011-07-17 17:52:03 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* 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.
|
|
|
|
*/
|
2007-09-18 15:08:20 -07:00
|
|
|
struct disasm_index {
|
|
|
|
const void *p;
|
|
|
|
int n;
|
|
|
|
};
|
|
|
|
|
2007-09-11 04:16:57 +00:00
|
|
|
/* Tables for the assembler and disassembler, respectively */
|
|
|
|
extern const struct itemplate * const nasm_instructions[];
|
2007-09-18 15:08:20 -07:00
|
|
|
extern const struct disasm_index itable[256];
|
2013-08-15 19:01:25 -07:00
|
|
|
extern const struct disasm_index * const itable_vex[NASM_VEX_CLASSES][32][4];
|
2007-09-11 04:16:57 +00:00
|
|
|
|
2008-05-13 14:29:47 -07:00
|
|
|
/* Common table for the byte codes */
|
|
|
|
extern const uint8_t nasm_bytecodes[];
|
|
|
|
|
2006-03-02 18:35:09 +00:00
|
|
|
/*
|
|
|
|
* this define is used to signify the end of an itemplate
|
2002-05-14 22:38:55 +00:00
|
|
|
*/
|
2013-08-15 19:01:25 -07:00
|
|
|
#define ITEMPLATE_END {-1,-1,{-1,-1,-1,-1,-1},{-1,-1,-1,-1,-1},NULL,0}
|
2002-05-14 22:38:55 +00:00
|
|
|
|
2011-07-17 17:52:03 +04:00
|
|
|
#endif /* NASM_INSNS_H */
|