em_comp.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. #ifndef __EMCOMP_INCLUDED__
  7. #define __EMCOMP_INCLUDED__
  8. #include <ansi.h>
  9. struct e_arg {
  10. int ema_argtype; /* type of this argument */
  11. union e_simple_arg {
  12. arith emu_cst; /* a cst */
  13. label emu_dlb; /* a numeric data label */
  14. label emu_ilb; /* an instruction label */
  15. char *emu_dnam; /* a data label */
  16. char *emu_pnam; /* a procedure name */
  17. char *emu_string; /* a string (fcon,icon,ucon,scon) */
  18. } ema_arg;
  19. arith ema_szoroff;
  20. };
  21. #define ema_cst ema_arg.emu_cst
  22. #define ema_dlb ema_arg.emu_dlb
  23. #define ema_ilb ema_arg.emu_ilb
  24. #define ema_dnam ema_arg.emu_dnam
  25. #define ema_pnam ema_arg.emu_pnam
  26. #define ema_nlocals ema_szoroff
  27. #define ema_string ema_arg.emu_string
  28. struct e_instr {
  29. int em_type; /* Type of this instr */
  30. #define EM_MNEM 256 /* A machine instruction */
  31. #define EM_PSEU 257 /* A pseudo */
  32. #define EM_STARTMES 258 /* Start of a MES pseudo */
  33. #define EM_MESARG 259 /* A member in a MES list */
  34. #define EM_ENDMES 260 /* End of a MES pseudo */
  35. #define EM_DEFILB 261 /* An instruction label definition */
  36. #define EM_DEFDLB 262 /* A numeric data label definition */
  37. #define EM_DEFDNAM 263 /* A non-numeric data label def */
  38. #define EM_ERROR 264 /* Recoverable error */
  39. #define EM_FATAL 265 /* Unrecoverable error */
  40. #define EM_EOF 266 /* End of file */
  41. int em_opcode;
  42. struct e_arg em_arg;
  43. };
  44. _PROTOTYPE(int EM_open, (char *));
  45. _PROTOTYPE(void EM_close, (void));
  46. _PROTOTYPE(int EM_getinstr, (struct e_instr *));
  47. _PROTOTYPE(int EM_mkcalls, (struct e_instr *));
  48. extern arith
  49. EM_holsize;
  50. #define EM_bsssize EM_holsize
  51. extern int
  52. EM_holinit;
  53. #define EM_bssinit EM_holinit
  54. #define em_ilb em_arg.ema_ilb
  55. #define em_dlb em_arg.ema_dlb
  56. #define em_dnam em_arg.ema_dnam
  57. #define em_argtype em_arg.ema_argtype
  58. #define em_cst em_arg.ema_cst
  59. #define em_pnam em_arg.ema_pnam
  60. #define em_nlocals em_arg.ema_nlocals
  61. #define em_string em_arg.ema_string
  62. #define em_off em_arg.ema_szoroff
  63. #define em_size em_arg.ema_szoroff
  64. /* Arguments for EXC pseudo: */
  65. #define em_exc1 em_arg.ema_cst
  66. #define em_exc2 em_arg.ema_szoroff
  67. extern char
  68. *EM_error, *EM_filename;
  69. extern unsigned int
  70. EM_lineno;
  71. extern int
  72. EM_wordsize, EM_pointersize;
  73. #endif /* __EMCOMP_INCLUDED__ */