brk.e 521 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #
  2. #include <em_abs.h>
  3. mes 2,EM_WSIZE,EM_PSIZE
  4. .1
  5. bss EM_PSIZE,0,0
  6. .2
  7. bss EM_WSIZE,0,0
  8. pro $ctch,0
  9. lol 0
  10. loc EHEAP
  11. beq *1
  12. lae .1
  13. loi EM_PSIZE
  14. sig
  15. asp EM_PSIZE
  16. lol 0
  17. trp
  18. rtt
  19. 1
  20. loc 1
  21. ste .2
  22. rtt
  23. end
  24. exp $brk
  25. pro $brk,0
  26. lpi $ctch
  27. sig
  28. lae .1
  29. sti EM_PSIZE
  30. loc 0
  31. ste .2
  32. lal 0
  33. loi EM_PSIZE
  34. str 2 ; The - possibly - occurring trap is caught
  35. lae .1
  36. loi EM_PSIZE
  37. sig
  38. asp EM_PSIZE
  39. loe .2
  40. zgt *1
  41. zer EM_PSIZE
  42. ret EM_PSIZE
  43. 1
  44. loc -1
  45. loc EM_WSIZE
  46. loc EM_PSIZE
  47. cii
  48. ret EM_PSIZE
  49. end