mach.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. /* $Header$ */
  6. /* The next define switches between codegeneration for an ACK assembler
  7. * or for the standard UNIX V7 assembler.
  8. * If on code is generated for the ACK assembler.
  9. */
  10. #define ACK_ASS /* code for ACK assembler */
  11. #ifdef ACK_ASS
  12. #define COMMENTCHAR '!'
  13. #define ex_ap(y) fprintf(codefile,".extern %s\n",y)
  14. #else
  15. #define COMMENTCHAR '/'
  16. #define ex_ap(y) fprintf(codefile,".globl %s\n",y)
  17. #endif
  18. #define in_ap(y) /* nothing */
  19. #define newplb(x) fprintf(codefile,"%s:\n",x)
  20. #define newilb(x) fprintf(codefile,"%s:\n",x)
  21. #define newdlb(x) fprintf(codefile,"%s:\n",x)
  22. #ifdef ACK_ASS
  23. #define newlbss(l,x) fprintf(codefile,".comm %s,%u\n",l,x);
  24. #else
  25. #define newlbss(l,x) fprintf(codefile,"%s:.=.+0%o\n",l,x);
  26. #endif
  27. #define cst_fmt "$0%o"
  28. #define off_fmt "0%o"
  29. #define ilb_fmt "I%x_%x"
  30. #define dlb_fmt "_%d"
  31. #define hol_fmt "hol%d"
  32. #define hol_off "0%lo+hol%d"
  33. #ifdef ACK_ASS
  34. #define con_cst(x) fprintf(codefile,".data2 0%lo\n",x)
  35. #define con_ilb(x) fprintf(codefile,".data2 %s\n",x)
  36. #define con_dlb(x) fprintf(codefile,".data2 %s\n",x)
  37. #else
  38. #define con_cst(x) fprintf(codefile,"0%lo\n",x)
  39. #define con_ilb(x) fprintf(codefile,"%s\n",x)
  40. #define con_dlb(x) fprintf(codefile,"%s\n",x)
  41. #endif
  42. #ifdef ACK_ASS
  43. #define modhead ".sect .text; .sect .rom; .sect .data; .sect .bss\n"
  44. #define fmt_id(f,t) sprintf(t,"_%s",f)
  45. #else
  46. #define id_first '_'
  47. #endif
  48. #define BSS_INIT 0