Back to index

cell-binutils  2.17cvs20070401
pj.h
Go to the documentation of this file.
00001 /* Definitions for decoding the picoJava opcode table.
00002    Copyright 1999, 2002, 2003 Free Software Foundation, Inc.
00003    Contributed by Steve Chamberlain of Transmeta (sac@pobox.com).
00004 
00005 This program is free software; you can redistribute it and/or modify
00006 it under the terms of the GNU General Public License as published by
00007 the Free Software Foundation; either version 2 of the License, or
00008 (at your option) any later version.
00009 
00010 This program is distributed in the hope that it will be useful,
00011 but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 GNU General Public License for more details.
00014 
00015 You should have received a copy of the GNU General Public License
00016 along with this program; if not, write to the Free Software
00017 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
00018 
00019 
00020 /* Names used to describe the type of instruction arguments, used by
00021    the assembler and disassembler.  Attributes are encoded in various fields. */
00022 
00023 /*            reloc  size pcrel    uns */
00024 #define O_N    0
00025 #define O_16  (1<<4 | 2 | (0<<6) | (0<<3))
00026 #define O_U16 (1<<4 | 2 | (0<<6) | (1<<3))
00027 #define O_R16 (2<<4 | 2 | (1<<6) | (0<<3))
00028 #define O_8   (3<<4 | 1 | (0<<6) | (0<<3))
00029 #define O_U8  (3<<4 | 1 | (0<<6) | (1<<3))
00030 #define O_R8  (4<<4 | 1 | (0<<6) | (0<<3))
00031 #define O_R32 (5<<4 | 4 | (1<<6) | (0<<3))
00032 #define O_32  (6<<4 | 4 | (0<<6) | (0<<3))
00033 
00034 #define ASIZE(x)  ((x) & 0x7)
00035 #define PCREL(x)  (!!((x) & (1<<6)))
00036 #define UNS(x)    (!!((x) & (1<<3)))
00037 
00038                   
00039 typedef struct pj_opc_info_t
00040 {
00041   short opcode;
00042   short opcode_next;
00043   char len;
00044   unsigned char arg[2];
00045   union {
00046     const char *name;
00047     void (*func) (struct pj_opc_info_t *, char *);
00048   } u;
00049 } pj_opc_info_t;