head_ac.e 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. #
  2. #include "em_abs.h"
  3. /*
  4. * (c) copyright 1983 by the Vrije Universiteit, Amsterdam, The Netherlands.
  5. *
  6. * This product is part of the Amsterdam Compiler Kit.
  7. *
  8. * Permission to use, sell, duplicate or disclose this software must be
  9. * obtained in writing. Requests for such permissions may be sent to
  10. *
  11. * Dr. Andrew S. Tanenbaum
  12. * Wiskundig Seminarium
  13. * Vrije Universiteit
  14. * Postbox 7161
  15. * 1007 MC Amsterdam
  16. * The Netherlands
  17. *
  18. */
  19. /* Author: E.G. Keizer */
  20. mes 2,_EM_WSIZE,_EM_PSIZE
  21. exa environ
  22. exa _end
  23. exa _penvp
  24. _penvp
  25. bss _EM_PSIZE,0,0
  26. exp $m_a_i_n
  27. pro $m_a_i_n,0
  28. loc 1336 ; EIOVFL | EIUND | ECONV | EFOVFL | EFUNFL
  29. sim ; ignored
  30. lal _EM_WSIZE+_EM_PSIZE
  31. loi _EM_PSIZE
  32. lae _penvp
  33. sti _EM_PSIZE
  34. /* Now test if environ is our own environ, or some user defined environ.
  35. * First test if environ < _end. This is done for separate I&D systems.
  36. */
  37. lae environ
  38. lae _end
  39. cmp
  40. zge *1
  41. /* Now environ < end, which means that we can derefence it without trouble
  42. * on separate I&D systems.
  43. */
  44. lae environ
  45. loi 2
  46. loc 2
  47. loc _EM_WSIZE
  48. cii
  49. loc 21331 /* == 0x5353 */
  50. bne *1
  51. /* environ contains the magic value. Assume it's our own environ */
  52. lae _envp
  53. loi _EM_PSIZE
  54. lae environ
  55. sti _EM_PSIZE
  56. 1
  57. #if unix && ! (em22 || em24 || em44)
  58. lpi $_ctch_
  59. sig
  60. asp _EM_PSIZE
  61. #endif
  62. lal _EM_WSIZE+_EM_PSIZE
  63. loi _EM_PSIZE
  64. lal _EM_WSIZE
  65. loi _EM_PSIZE
  66. lal 0
  67. loi _EM_WSIZE
  68. cal $main
  69. asp _EM_WSIZE+_EM_PSIZE+_EM_PSIZE
  70. lfr _EM_WSIZE
  71. cal $exit
  72. end
  73. #if unix && ! (em22 || em24 || em44)
  74. exp $_ctch_
  75. pro $_ctch_,0
  76. lol 0
  77. loc EIDIVZ
  78. beq *1
  79. lol 0
  80. loc EFDIVZ
  81. beq *1
  82. lol 0
  83. trp
  84. bra *3
  85. 1
  86. loc 8
  87. cal $_getpid
  88. lfr _EM_WSIZE
  89. cal $_kill
  90. asp 2*_EM_WSIZE
  91. 3
  92. lpi $_ctch_
  93. sig
  94. asp _EM_PSIZE
  95. rtt
  96. end 0
  97. #endif