From eddb43c08e3550fea7a54330c35843087d7906a6 Mon Sep 17 00:00:00 2001 From: ceriel Date: Mon, 11 Apr 1988 12:51:22 +0000 Subject: [PATCH] catch possibly occurring trap with stores in the HP --- lang/cem/libcc/mon/brk.e | 46 +++++++++++++++++++++++++++++++++++++- lang/cem/libcc/mon/sbrk.e | 47 ++++++++++++++++++++++++++++++++++++++- 2 files changed, 91 insertions(+), 2 deletions(-) diff --git a/lang/cem/libcc/mon/brk.e b/lang/cem/libcc/mon/brk.e index 9e4d44800..548cc307d 100644 --- a/lang/cem/libcc/mon/brk.e +++ b/lang/cem/libcc/mon/brk.e @@ -1,10 +1,54 @@ # +#include + mes 2,EM_WSIZE,EM_PSIZE + +.1 + bss EM_PSIZE,0,0 +.2 + bss EM_WSIZE,0,0 + + pro $ctch,0 + lol 0 + loc EHEAP + beq *1 + lae .1 + loi EM_PSIZE + sig + asp EM_PSIZE + lol 0 + trp + rtt +1 + loc 1 + ste .2 + rtt + end + + exp $brk pro $brk,0 lal 0 loi EM_PSIZE - str 2 ; The - possibly - occurring traps should be caught + lpi $ctch + sig + lae .1 + sti EM_PSIZE + loc 0 + ste .2 + str 2 ; The - possibly - occurring trap is caught + lae .1 + loi EM_PSIZE + sig + asp EM_PSIZE + loe .2 + zgt *1 zer EM_PSIZE ret EM_PSIZE +1 + loc -1 + loc EM_WSIZE + loc EM_PSIZE + cii + ret EM_PSIZE end diff --git a/lang/cem/libcc/mon/sbrk.e b/lang/cem/libcc/mon/sbrk.e index bed013837..ce323761f 100644 --- a/lang/cem/libcc/mon/sbrk.e +++ b/lang/cem/libcc/mon/sbrk.e @@ -1,11 +1,56 @@ # +#include + mes 2,EM_WSIZE,EM_PSIZE + +.1 + bss EM_PSIZE,0,0 +.2 + bss EM_WSIZE,0,0 + + pro $ctch,0 + lol 0 + loc EHEAP + beq *1 + lae .1 + loi EM_PSIZE + sig + asp EM_PSIZE + lol 0 + trp + rtt +1 + loc 1 + ste .2 + rtt + end + + exp $sbrk pro $sbrk,0 lor 2 lor 2 + lpi $ctch + sig + lae .1 + sti EM_PSIZE + loc 0 + ste .2 lol 0 ads EM_WSIZE - str 2 ; The - possibly - occurring traps should be caught + str 2 ; The - possibly - occurring trap is caught + lae .1 + loi EM_PSIZE + sig + asp EM_PSIZE + loe .2 + zgt *1 + ret EM_PSIZE +1 + asp EM_PSIZE + loc -1 + loc EM_WSIZE + loc EM_PSIZE + cii ret EM_PSIZE end -- 2.34.1