head_ac.e 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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. mes 2,_EM_WSIZE,_EM_PSIZE
  20. exa environ
  21. exa _end
  22. exa _penvp
  23. _penvp
  24. bss _EM_PSIZE,0,0
  25. exp $_m_a_i_n
  26. pro $_m_a_i_n,0
  27. loc 1336 ; EIOVFL | EIUND | ECONV | EFOVFL | EFUNFL
  28. sim ; ignored
  29. lal _EM_WSIZE+_EM_PSIZE
  30. loi _EM_PSIZE
  31. lae _penvp
  32. sti _EM_PSIZE
  33. /* Now test if environ is our own environ, or some user defined environ.
  34. * First test if environ < _end. This is done for separate I&D systems.
  35. */
  36. lae environ
  37. lae _end
  38. cmp
  39. zge *1
  40. /* Now environ < end, which means that we can derefence it without trouble
  41. * on separate I&D systems.
  42. */
  43. lae environ
  44. loi 2
  45. loc 2
  46. loc _EM_WSIZE
  47. cii
  48. loc 21331 /* == 0x5353 */
  49. bne *1
  50. /* environ contains the magic value. Assume it's our own environ */
  51. lae _penvp
  52. loi _EM_PSIZE
  53. lae environ
  54. sti _EM_PSIZE
  55. 1
  56. #if unix && ! (em22 || em24 || em44)
  57. lpi $_ctch_
  58. sig
  59. asp _EM_PSIZE
  60. #endif
  61. lal _EM_WSIZE+_EM_PSIZE
  62. loi _EM_PSIZE
  63. lal _EM_WSIZE
  64. loi _EM_PSIZE
  65. lal 0
  66. loi _EM_WSIZE
  67. cal $main
  68. asp _EM_WSIZE+_EM_PSIZE+_EM_PSIZE
  69. lfr _EM_WSIZE
  70. cal $exit
  71. end
  72. #if unix && ! (em22 || em24 || em44)
  73. exp $_ctch_
  74. pro $_ctch_,0
  75. lol 0
  76. loc EIDIVZ
  77. beq *1
  78. lol 0
  79. loc EFDIVZ
  80. beq *1
  81. lol 0
  82. trp
  83. bra *3
  84. 1
  85. loc 8
  86. cal $_getpid
  87. lfr _EM_WSIZE
  88. cal $_kill
  89. asp 2*_EM_WSIZE
  90. 3
  91. lpi $_ctch_
  92. sig
  93. asp _EM_PSIZE
  94. rtt
  95. end 0
  96. #endif