Back to index

cell-binutils  2.17cvs20070401
vax-inst.h
Go to the documentation of this file.
00001 /* vax-inst.h - GNU - Part of vax.c
00002    Copyright 1987, 1992, 1995, 2000, 2002 Free Software Foundation, Inc.
00003 
00004    This file is part of GAS, the GNU Assembler.
00005 
00006    GAS is free software; you can redistribute it and/or modify
00007    it under the terms of the GNU General Public License as published by
00008    the Free Software Foundation; either version 2, or (at your option)
00009    any later version.
00010 
00011    GAS 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 GAS; see the file COPYING.  If not, write to
00018    the Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
00019 
00020 /*
00021  * This is part of vax-ins-parse.c & friends.
00022  * We want to parse a vax instruction text into a tree defined here.
00023  */
00024 
00025 #define VIT_MAX_OPERANDS (6)       /* maximum number of operands in one       */
00026 /* single vax instruction */
00027 
00028 struct vop                  /* vax instruction operand                 */
00029 {
00030   short int vop_ndx;        /* -1, or index register. eg 7=[R7]          */
00031   short int vop_reg;        /* -1, or register number. eg @I^#=0xF     */
00032   /* Helps distinguish "abs" from "abs(PC)".  */
00033   short int vop_mode;              /* addressing mode 4 bits. eg I^#=0x9        */
00034   char vop_short;           /* operand displacement length as written  */
00035   /* ' '=none, "bilsw"=B^I^L^S^W^.           */
00036   char vop_access;          /* 'b'branch ' 'no-instruction 'amrvw'norm */
00037   char vop_width;           /* Operand width, one of "bdfghloqw"         */
00038   const char *vop_warn;            /* warning message of this operand, if any */
00039   const char *vop_error;    /* say if operand is inappropriate         */
00040   char *vop_expr_begin;            /* Unparsed expression, 1st char ...         */
00041   char *vop_expr_end;              /* ... last char.                     */
00042   unsigned char vop_nbytes; /* number of bytes in datum           */
00043 };
00044 
00045 typedef long vax_opcodeT;   /* For initialising array of opcodes         */
00046 /* Some synthetic opcodes > 16 bits!       */
00047 
00048 #define VIT_OPCODE_SYNTHETIC 0x80000000   /* Not real hardware instruction.  */
00049 #define VIT_OPCODE_SPECIAL   0x40000000   /* Not normal branch optimising.   */
00050 /* Never set without ..._SYNTHETIC */
00051 
00052 #define VAX_WIDTH_UNCONDITIONAL_JUMP '-'  /* These are encoded into         */
00053 #define VAX_WIDTH_CONDITIONAL_JUMP   '?'  /* vop_width when vop_access=='b' */
00054 #define VAX_WIDTH_WORD_JUMP          '!'  /* and VIT_OPCODE_SYNTHETIC set.  */
00055 #define VAX_WIDTH_BYTE_JUMP      ':'      /*                                */
00056 
00057 #define VAX_JSB (0x16)             /* Jump to subroutine                        */
00058 #define VAX_JMP (0x17)             /* Useful for branch optimising. Jump instr*/
00059 #define VAX_PC_RELATIVE_MODE (0xef)       /* Use it after VAX_JMP               */
00060 #define VAX_ABSOLUTE_MODE (0x9F)/* Use as @#...                   */
00061 #define VAX_BRB (0x11)             /* Canonical branch.                  */
00062 #define VAX_BRW (0x31)             /* Another canonical branch           */
00063 #define VAX_CALLS (0xFB)    /* Call with arg list on stack                */
00064 #define VAX_CALLG (0xFA)    /* Call with arg list in memory              */
00065 #define VAX_WIDEN_WORD (0x20)      /* Add this to byte branch to get word br.  */
00066 #define VAX_WIDEN_LONG (0x6)       /* Add this to byte branch to get long jmp.*/
00067 /* Needs VAX_PC_RELATIVE_MODE byte after it*/
00068 
00069 struct vit                  /* vax instruction tree                    */
00070 {
00071   /* vit_opcode is char[] for portability.   */
00072   char vit_opcode[sizeof (vax_opcodeT)];
00073   unsigned char vit_opcode_nbytes; /* How long is _opcode? (chars)       */
00074   unsigned char vit_operands;      /*                                    */
00075   struct vop vit_operand[VIT_MAX_OPERANDS];      /* operands             */
00076   const char *vit_error;    /* "" or error text */
00077 };
00078 
00079 /* end of vax-inst.h */