mirror of https://github.com/yasm/yasm.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
72 lines
2.2 KiB
72 lines
2.2 KiB
24 years ago
|
/* $IdPath$
|
||
|
* Bytecode internal structures header file
|
||
|
*
|
||
|
* Copyright (C) 2001 Peter Johnson
|
||
|
*
|
||
|
* This file is part of YASM.
|
||
|
*
|
||
|
* YASM is free software; you can redistribute it and/or modify
|
||
|
* it under the terms of the GNU General Public License as published by
|
||
|
* the Free Software Foundation; either version 2 of the License, or
|
||
|
* (at your option) any later version.
|
||
|
*
|
||
|
* YASM is distributed in the hope that it will be useful,
|
||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
|
* GNU General Public License for more details.
|
||
|
*
|
||
|
* You should have received a copy of the GNU General Public License
|
||
|
* along with this program; if not, write to the Free Software
|
||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||
|
*/
|
||
|
#ifndef YASM_BC_INT_H
|
||
|
#define YASM_BC_INT_H
|
||
|
|
||
|
struct effaddr {
|
||
|
expr *disp; /* address displacement */
|
||
|
unsigned char len; /* length of disp (in bytes), 0 if unknown,
|
||
|
* 0xff if unknown and required to be >0.
|
||
|
*/
|
||
|
unsigned char nosplit; /* 1 if reg*2 should not be split into
|
||
|
reg+reg. (0 if not) */
|
||
|
|
||
|
/* architecture-dependent data may be appended */
|
||
|
};
|
||
|
#define ea_get_data(x) (void *)(((char *)x)+sizeof(effaddr))
|
||
|
#define ea_get_const_data(x) (const void *)(((const char *)x)+sizeof(effaddr))
|
||
|
|
||
|
struct immval {
|
||
|
expr *val;
|
||
|
|
||
|
unsigned char len; /* length of val (in bytes), 0 if unknown */
|
||
|
unsigned char isneg; /* the value has been explicitly negated */
|
||
|
|
||
|
unsigned char f_len; /* final imm length */
|
||
|
unsigned char f_sign; /* 1 if final imm should be signed */
|
||
|
};
|
||
|
|
||
|
struct bytecode {
|
||
|
STAILQ_ENTRY(bytecode) link;
|
||
|
|
||
|
bytecode_type type;
|
||
|
|
||
|
expr *multiple; /* number of times bytecode is repeated,
|
||
|
NULL=1 */
|
||
|
|
||
|
unsigned long len; /* total length of entire bytecode (including
|
||
|
multiple copies), 0 if unknown */
|
||
|
|
||
|
/* where it came from */
|
||
|
const char *filename;
|
||
|
unsigned int lineno;
|
||
|
|
||
|
/* other assembler state info */
|
||
|
unsigned long offset; /* 0 if unknown */
|
||
|
|
||
|
/* architecture-dependent data may be appended */
|
||
|
};
|
||
|
#define bc_get_data(x) (void *)(((char *)x)+sizeof(bytecode))
|
||
|
#define bc_get_const_data(x) (const void *)(((const char *)x)+sizeof(bytecode))
|
||
|
|
||
|
#endif
|