mach.c 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /* $Id$ */
  2. /*
  3. * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
  4. * See the copyright notice in the ACK home directory, in the file "Copyright".
  5. *
  6. */
  7. /*
  8. * machine dependent back end routines for the z8000
  9. */
  10. con_part(sz,w) register sz; word w; {
  11. while (part_size % sz)
  12. part_size++;
  13. if (part_size == TEM_WSIZE)
  14. part_flush();
  15. if (sz == 1) {
  16. w &= 0xFF;
  17. if (part_size == 0)
  18. w <<= 8;
  19. part_word |= w;
  20. } else {
  21. assert(sz == 2);
  22. part_word = w;
  23. }
  24. part_size += sz;
  25. }
  26. con_mult(sz) word sz; {
  27. if (sz != 4)
  28. fatal("bad icon/ucon size");
  29. fprintf(codefile,"\t.data4 %s\n", str);
  30. }
  31. con_float() {
  32. static int been_here;
  33. if (argval != 4 && argval != 8)
  34. fatal("bad fcon size");
  35. fprintf(codefile,"\t.data4 ");
  36. if (argval == 8)
  37. fprintf(codefile,"F_DUM, ");
  38. fprintf(codefile,"F_DUM\n");
  39. if ( !been_here++)
  40. {
  41. fprintf(stderr,"Warning : dummy float-constant(s)\n");
  42. }
  43. }
  44. /*
  45. string holstr(n) word n; {
  46. sprintf(str,hol_off,n,holno);
  47. return(mystrcpy(str));
  48. }
  49. */
  50. prolog(nlocals) full nlocals; {
  51. fprintf(codefile,"\tpush\t*RR14, R13\n\tld\tR13, R15\n");
  52. if (nlocals == 0)
  53. return;
  54. else
  55. fprintf(codefile,"\tsub\tR15, $%d\n",nlocals);
  56. }
  57. mes(type) word type ; {
  58. int argt ;
  59. switch ( (int)type ) {
  60. case ms_ext :
  61. for (;;) {
  62. switch ( argt=getarg(
  63. ptyp(sp_cend)|ptyp(sp_pnam)|sym_ptyp) ) {
  64. case sp_cend :
  65. return ;
  66. default:
  67. strarg(argt) ;
  68. printf(".define %s\n",argstr) ;
  69. break ;
  70. }
  71. }
  72. default :
  73. while ( getarg(any_ptyp) != sp_cend ) ;
  74. break ;
  75. }
  76. }
  77. char *segname[] = {
  78. ".sect .text", /* SEGTXT */
  79. ".sect .data", /* SEGCON */
  80. ".sect .rom", /* SEGROM */
  81. ".sect .bss" /* SEGBSS */
  82. };