em.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /* $Header$ */
  2. /* DESCRIPTION OF INTERFACE TO EM CODE GENERATING ROUTINES */
  3. #include "proc_intf.h" /* use macros or functions */
  4. /* include the EM description files */
  5. #include <em_spec.h>
  6. #include <em_pseu.h>
  7. #include <em_mes.h>
  8. #include <em_mnem.h>
  9. #include <em_reg.h>
  10. /* macros used in the definitions of the interface functions C_* */
  11. #define OP(x) put_op(x)
  12. #define CST(x) put_cst(x)
  13. #define DCST(x) put_cst(x)
  14. #define CSTR(x) put_cstr(x)
  15. #define PS(x) put_ps(x)
  16. #define DLB(x) put_dlb(x)
  17. #define ILB(x) put_ilb(x)
  18. #define NOFF(x,y) put_noff((x), (y))
  19. #define DOFF(x,y) put_doff((x), (y))
  20. #define PNAM(x) put_pnam(x)
  21. #define DNAM(x) put_dnam(x)
  22. #define CEND() put_cend()
  23. #define WCON(x,y,z) put_wcon((x), (y), (z))
  24. #define FCON(x,y) put_fcon((x), (y))
  25. /* variants of primitive "putbyte" */
  26. #define put8(x) putbyte(x) /* defined in "em.c" */
  27. #define put16(x) (put8((int) x), put8((int) (x >> 8)))
  28. #define put32(x) (put16((int) x), put16((int) (x >> 16)))
  29. #define put_cend() put8(sp_cend)
  30. #define put_op(x) put8(x)
  31. #define put_ps(x) put8(x)
  32. /* user interface */
  33. #define C_magic() put16(sp_magic) /* EM magic word */
  34. #ifndef PROC_INTF
  35. #include "writeem.h"
  36. #endif PROC_INTF