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