00001 /* 00002 * HT Editor 00003 * javaopc.h 00004 * 00005 * Copyright (C) 1999-2002 Stefan Weyergraf (stefan@weyergraf.de) 00006 * 00007 * This program is free software; you can redistribute it and/or modify 00008 * it under the terms of the GNU General Public License version 2 as 00009 * published by the Free Software Foundation. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with this program; if not, write to the Free Software 00018 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00019 */ 00020 00021 #ifndef __JAVAOPC_H__ 00022 #define __JAVAOPC_H__ 00023 00024 #include "common.h" 00025 00026 #define JAVA_OPTYPE_EMPTY 0 00027 #define JAVA_OPTYPE_IMM 1 00028 #define JAVA_OPTYPE_DBL 2 00029 #define JAVA_OPTYPE_REF 3 00030 #define JAVA_OPTYPE_LABEL 4 00031 #define JAVA_OPTYPE_CONST 5 00032 00033 #define JOPC_TYPE(t) ((t) & 0x0f) 00034 #define JOPC_TYPE_EMPTY 0 00035 #define JOPC_TYPE_BYTE 1 00036 #define JOPC_TYPE_SHORT 2 00037 #define JOPC_TYPE_INT 3 00038 #define JOPC_TYPE_CHAR 4 00039 #define JOPC_TYPE_CONST 5 00040 #define JOPC_TYPE_LOCAL 6 00041 #define JOPC_TYPE_LABEL 7 00042 00043 #define JOPC_SIZE(t) ((t) & 0xf0) 00044 #define JOPC_SIZE_VAR 0x00 00045 #define JOPC_SIZE_SMALL 0x40 00046 #define JOPC_SIZE_WIDE 0x80 00047 00048 struct java_insn_op { 00049 int type; 00050 int size; 00051 union { 00052 dword imm; 00053 dword label; 00054 double dbl; 00055 dword ref; 00056 }; 00057 }; 00058 00059 struct javaopc_insn { 00060 char *name; 00061 int optype[2]; 00062 }; 00063 00064 #define JAVA_WIDE_OPCODE 0xc4 00065 extern javaopc_insn java_insns[256]; 00066 00067 #endif /* __JAVAOPC_H__ */ 00068