pj.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /* Definitions for decoding the picoJava opcode table.
  2. Copyright (C) 1999-2015 Free Software Foundation, Inc.
  3. Contributed by Steve Chamberlain of Transmeta (sac@pobox.com).
  4. This program 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 3 of the License, or
  7. (at your option) any later version.
  8. This program 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 this program; if not, write to the Free Software
  14. Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
  15. MA 02110-1301, USA. */
  16. /* Names used to describe the type of instruction arguments, used by
  17. the assembler and disassembler. Attributes are encoded in various fields. */
  18. /* reloc size pcrel uns */
  19. #define O_N 0
  20. #define O_16 (1<<4 | 2 | (0<<6) | (0<<3))
  21. #define O_U16 (1<<4 | 2 | (0<<6) | (1<<3))
  22. #define O_R16 (2<<4 | 2 | (1<<6) | (0<<3))
  23. #define O_8 (3<<4 | 1 | (0<<6) | (0<<3))
  24. #define O_U8 (3<<4 | 1 | (0<<6) | (1<<3))
  25. #define O_R8 (4<<4 | 1 | (0<<6) | (0<<3))
  26. #define O_R32 (5<<4 | 4 | (1<<6) | (0<<3))
  27. #define O_32 (6<<4 | 4 | (0<<6) | (0<<3))
  28. #define ASIZE(x) ((x) & 0x7)
  29. #define PCREL(x) (!!((x) & (1<<6)))
  30. #define UNS(x) (!!((x) & (1<<3)))
  31. typedef struct pj_opc_info_t
  32. {
  33. short opcode;
  34. short opcode_next;
  35. char len;
  36. unsigned char arg[2];
  37. union {
  38. const char *name;
  39. void (*func) (struct pj_opc_info_t *, char *);
  40. } u;
  41. } pj_opc_info_t;