mn10200.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. /* mn10200.h -- Header file for Matsushita 10200 opcode table
  2. Copyright (C) 1996-2022 Free Software Foundation, Inc.
  3. Written by Jeff Law, Cygnus Support
  4. This file is part of GDB, GAS, and the GNU binutils.
  5. GDB, GAS, and the GNU binutils are free software; you can redistribute
  6. them and/or modify them under the terms of the GNU General Public
  7. License as published by the Free Software Foundation; either version 3,
  8. or (at your option) any later version.
  9. GDB, GAS, and the GNU binutils are distributed in the hope that they
  10. will be useful, but WITHOUT ANY WARRANTY; without even the implied
  11. warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  12. the GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this file; see the file COPYING3. If not, write to the Free
  15. Software Foundation, 51 Franklin Street - Fifth Floor, Boston,
  16. MA 02110-1301, USA. */
  17. #ifndef MN10200_H
  18. #define MN10200_H
  19. /* The opcode table is an array of struct mn10200_opcode. */
  20. struct mn10200_opcode
  21. {
  22. /* The opcode name. */
  23. const char *name;
  24. /* The opcode itself. Those bits which will be filled in with
  25. operands are zeroes. */
  26. unsigned long opcode;
  27. /* The opcode mask. This is used by the disassembler. This is a
  28. mask containing ones indicating those bits which must match the
  29. opcode field, and zeroes indicating those bits which need not
  30. match (and are presumably filled in by operands). */
  31. unsigned long mask;
  32. /* The format of this opcode. */
  33. unsigned char format;
  34. /* An array of operand codes. Each code is an index into the
  35. operand table. They appear in the order which the operands must
  36. appear in assembly code, and are terminated by a zero. */
  37. unsigned char operands[8];
  38. };
  39. /* The table itself is sorted by major opcode number, and is otherwise
  40. in the order in which the disassembler should consider
  41. instructions. */
  42. extern const struct mn10200_opcode mn10200_opcodes[];
  43. extern const int mn10200_num_opcodes;
  44. /* The operands table is an array of struct mn10200_operand. */
  45. struct mn10200_operand
  46. {
  47. /* The number of bits in the operand. */
  48. int bits;
  49. /* How far the operand is left shifted in the instruction. */
  50. int shift;
  51. /* One bit syntax flags. */
  52. int flags;
  53. };
  54. /* Elements in the table are retrieved by indexing with values from
  55. the operands field of the mn10200_opcodes table. */
  56. extern const struct mn10200_operand mn10200_operands[];
  57. /* Values defined for the flags field of a struct mn10200_operand. */
  58. #define MN10200_OPERAND_DREG 0x1
  59. #define MN10200_OPERAND_AREG 0x2
  60. #define MN10200_OPERAND_PSW 0x4
  61. #define MN10200_OPERAND_MDR 0x8
  62. #define MN10200_OPERAND_SIGNED 0x10
  63. #define MN10200_OPERAND_PROMOTE 0x20
  64. #define MN10200_OPERAND_PAREN 0x40
  65. #define MN10200_OPERAND_REPEATED 0x80
  66. #define MN10200_OPERAND_EXTENDED 0x100
  67. #define MN10200_OPERAND_NOCHECK 0x200
  68. #define MN10200_OPERAND_PCREL 0x400
  69. #define MN10200_OPERAND_MEMADDR 0x800
  70. #define MN10200_OPERAND_RELAX 0x1000
  71. #define FMT_1 1
  72. #define FMT_2 2
  73. #define FMT_3 3
  74. #define FMT_4 4
  75. #define FMT_5 5
  76. #define FMT_6 6
  77. #define FMT_7 7
  78. #endif /* MN10200_H */