setsig.e 763 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #
  2. mes 2,EM_WSIZE,EM_PSIZE
  3. save
  4. bss EM_PSIZE,0,0
  5. trf
  6. bss EM_PSIZE,0,0
  7. exp $_setsig
  8. pro $_setsig,0
  9. lal 0
  10. loi EM_PSIZE
  11. lae trf
  12. sti EM_PSIZE
  13. inp $catchit
  14. lpi $catchit ; trap to catchit
  15. sig
  16. lae save ; remember higher level trap
  17. sti EM_PSIZE
  18. ret 0
  19. end
  20. pro $catchit,0
  21. lpi $catchit
  22. sig
  23. asp EM_PSIZE
  24. lol 0 ; fetch trapno
  25. lae trf
  26. loi EM_PSIZE ; fetch procedure identifier
  27. cai
  28. lfr EM_WSIZE
  29. zne *1
  30. ; trap not handled by trf function, trap through; trapno still on stack
  31. lae save
  32. loi EM_PSIZE
  33. sig
  34. asp EM_PSIZE
  35. trp
  36. lpi $catchit ; trap ignored, further traps to catchit
  37. sig
  38. asp EM_PSIZE
  39. lae save ; remember higher level trap
  40. sti EM_PSIZE
  41. 1
  42. rtt
  43. end