vax-inst.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /* vax-inst.h - GNU - Part of vax.c
  2. Copyright (C) 1987 Free Software Foundation, Inc.
  3. This file is part of GAS, the GNU Assembler.
  4. GAS is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 1, or (at your option)
  7. any later version.
  8. GAS is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with GAS; see the file COPYING. If not, write to
  14. the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
  15. /*
  16. * This is part of vax-ins-parse.c & friends.
  17. * We want to parse a vax instruction text into a tree defined here.
  18. */
  19. #define VIT_MAX_OPERANDS (6) /* maximum number of operands in one */
  20. /* single vax instruction */
  21. struct vop /* vax instruction operand */
  22. {
  23. short int vop_ndx; /* -1, or index register. eg 7=[R7] */
  24. short int vop_reg; /* -1, or register number. eg @I^#=0xF */
  25. /* Helps distinguish "abs" from "abs(PC)". */
  26. short int vop_mode; /* addressing mode 4 bits. eg I^#=0x9 */
  27. char vop_short; /* operand displacement length as written */
  28. /* ' '=none, "bilsw"=B^I^L^S^W^. */
  29. char vop_access; /* 'b'branch ' 'no-instruction 'amrvw'norm */
  30. char vop_width; /* Operand width, one of "bdfghloqw" */
  31. char * vop_warn; /* warning message of this operand, if any */
  32. char * vop_error; /* say if operand is inappropriate */
  33. char * vop_expr_begin; /* Unparsed expression, 1st char ... */
  34. char * vop_expr_end; /* ... last char. */
  35. unsigned char vop_nbytes; /* number of bytes in datum */
  36. };
  37. typedef long int vax_opcodeT; /* For initialising array of opcodes */
  38. /* Some synthetic opcodes > 16 bits! */
  39. #define VIT_OPCODE_SYNTHETIC 0x80000000 /* Not real hardware instruction. */
  40. #define VIT_OPCODE_SPECIAL 0x40000000 /* Not normal branch optimising. */
  41. /* Never set without ..._SYNTHETIC */
  42. #define VAX_WIDTH_UNCONDITIONAL_JUMP '-' /* These are encoded into */
  43. #define VAX_WIDTH_CONDITIONAL_JUMP '?' /* vop_width when vop_access=='b' */
  44. #define VAX_WIDTH_WORD_JUMP '!' /* and VIT_OPCODE_SYNTHETIC set. */
  45. #define VAX_WIDTH_BYTE_JUMP ':' /* */
  46. #define VAX_JMP (0x17) /* Useful for branch optimising. Jump instr*/
  47. #define VAX_PC_RELATIVE_MODE (0xef) /* Use it after VAX_JMP */
  48. #define VAX_ABSOLUTE_MODE (0x9F) /* Use as @#... */
  49. #define VAX_BRB (0x11) /* Canonical branch. */
  50. #define VAX_BRW (0x31) /* Another canonical branch */
  51. #define VAX_WIDEN_WORD (0x20) /* Add this to byte branch to get word br. */
  52. #define VAX_WIDEN_LONG (0x6) /* Add this to byte branch to get long jmp.*/
  53. /* Needs VAX_PC_RELATIVE_MODE byte after it*/
  54. struct vit /* vax instruction tree */
  55. {
  56. /* vit_opcode is char[] for portability. */
  57. char vit_opcode [ sizeof (vax_opcodeT) ];
  58. unsigned char vit_opcode_nbytes; /* How long is _opcode? (chars) */
  59. unsigned char vit_operands;/* */
  60. struct vop vit_operand[VIT_MAX_OPERANDS]; /* operands */
  61. char * vit_error; /* "" or error text */
  62. };
  63. /* end: vax-inst.h */