1f7cc78ecSespie /* Definitions for decoding the picoJava opcode table. 2*cf2f2c56Smiod Copyright 1999, 2002, 2003 Free Software Foundation, Inc. 3f7cc78ecSespie Contributed by Steve Chamberlain of Transmeta (sac@pobox.com). 4f7cc78ecSespie 5f7cc78ecSespie This program is free software; you can redistribute it and/or modify 6f7cc78ecSespie it under the terms of the GNU General Public License as published by 7f7cc78ecSespie the Free Software Foundation; either version 2 of the License, or 8f7cc78ecSespie (at your option) any later version. 9f7cc78ecSespie 10f7cc78ecSespie This program is distributed in the hope that it will be useful, 11f7cc78ecSespie but WITHOUT ANY WARRANTY; without even the implied warranty of 12f7cc78ecSespie MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13f7cc78ecSespie GNU General Public License for more details. 14f7cc78ecSespie 15f7cc78ecSespie You should have received a copy of the GNU General Public License 16f7cc78ecSespie along with this program; if not, write to the Free Software 17f7cc78ecSespie Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ 18f7cc78ecSespie 19f7cc78ecSespie 20f7cc78ecSespie /* Names used to describe the type of instruction arguments, used by 21f7cc78ecSespie the assembler and disassembler. Attributes are encoded in various fields. */ 22f7cc78ecSespie 23f7cc78ecSespie /* reloc size pcrel uns */ 24f7cc78ecSespie #define O_N 0 25f7cc78ecSespie #define O_16 (1<<4 | 2 | (0<<6) | (0<<3)) 26f7cc78ecSespie #define O_U16 (1<<4 | 2 | (0<<6) | (1<<3)) 27f7cc78ecSespie #define O_R16 (2<<4 | 2 | (1<<6) | (0<<3)) 28f7cc78ecSespie #define O_8 (3<<4 | 1 | (0<<6) | (0<<3)) 29f7cc78ecSespie #define O_U8 (3<<4 | 1 | (0<<6) | (1<<3)) 30f7cc78ecSespie #define O_R8 (4<<4 | 1 | (0<<6) | (0<<3)) 31f7cc78ecSespie #define O_R32 (5<<4 | 4 | (1<<6) | (0<<3)) 32f7cc78ecSespie #define O_32 (6<<4 | 4 | (0<<6) | (0<<3)) 33f7cc78ecSespie 34f7cc78ecSespie #define ASIZE(x) ((x) & 0x7) 35f7cc78ecSespie #define PCREL(x) (!!((x) & (1<<6))) 36f7cc78ecSespie #define UNS(x) (!!((x) & (1<<3))) 37f7cc78ecSespie 38f7cc78ecSespie 39d2201f2fSdrahn typedef struct pj_opc_info_t 40f7cc78ecSespie { 41f7cc78ecSespie short opcode; 42f7cc78ecSespie short opcode_next; 43f7cc78ecSespie char len; 44f7cc78ecSespie unsigned char arg[2]; 45d2201f2fSdrahn union { 46f7cc78ecSespie const char *name; 47*cf2f2c56Smiod void (*func) (struct pj_opc_info_t *, char *); 48d2201f2fSdrahn } u; 49f7cc78ecSespie } pj_opc_info_t; 50