line.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /*
  2. * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
  3. * See the copyright notice in the ACK home directory, in the file "Copyright".
  4. */
  5. /* $Id$ */
  6. #define NARGBYTES 14
  7. struct argbytes {
  8. argb_p ab_next;
  9. short ab_index;
  10. char ab_contents[NARGBYTES];
  11. };
  12. typedef struct {
  13. sym_p av_sp;
  14. offset av_offset;
  15. } s_a_val;
  16. typedef struct {
  17. short ac_length;
  18. argb_t ac_con;
  19. } s_a_con;
  20. typedef union {
  21. offset a_offset;
  22. num_p a_np;
  23. sym_p a_sp;
  24. s_a_val a_val;
  25. argb_t a_string;
  26. s_a_con a_con;
  27. } un_a_a;
  28. struct arg {
  29. arg_p a_next;
  30. short a_typ;
  31. un_a_a a_a;
  32. };
  33. /* possible values for .a_typ
  34. */
  35. #define ARGOFF 0
  36. #define ARGNUM 1
  37. #define ARGSYM 2
  38. #define ARGVAL 3
  39. #define ARGSTR 4
  40. #define ARGICN 5
  41. #define ARGUCN 6
  42. #define ARGFCN 7
  43. typedef struct {
  44. sym_p lasv_sp;
  45. short lasv_short;
  46. } s_la_sval;
  47. typedef struct {
  48. sym_p lalv_sp;
  49. offset lalv_offset;
  50. } s_la_lval;
  51. typedef union {
  52. short la_short;
  53. offset la_offset;
  54. num_p la_np;
  55. sym_p la_sp;
  56. s_la_sval la_sval;
  57. s_la_lval la_lval;
  58. arg_p la_arg;
  59. } un_l_a;
  60. struct line {
  61. line_p l_next; /* maintains linked list */
  62. byte l_instr; /* instruction number */
  63. byte l_optyp; /* specifies what follows */
  64. un_l_a l_a;
  65. };
  66. /* Possible values for .l_optyp */
  67. #define OPNO 0 /* no operand */
  68. #define OPSHORT 1 /* 16 bit number */
  69. #define OPOFFSET 2 /* 16 or 32 bit number */
  70. #define OPNUMLAB 3 /* local label for branches */
  71. #define OPSYMBOL 4 /* global label or procedurename */
  72. #define OPSVAL 5 /* symbol + 16 bit constant */
  73. #define OPLVAL 6 /* symbol + 16 or 32 bit constant */
  74. #define OPLIST 7 /* operand list for some pseudos */
  75. #define OPMINI 8 /* start of minis */
  76. #define Z_OPMINI (OPMINI+100) /* tunable */
  77. #define CANMINI(x) ((x)>=OPMINI-Z_OPMINI && (x)<256-Z_OPMINI)