3 ; (c) copyright 1988 by the Vrije Universiteit, Amsterdam, The Netherlands.
4 ; See the copyright notice in the ACK home directory, in the file "Copyright".
8 ; Module: coroutine primitives
9 ; Author: Kees Bot, Edwin Scheffer, Ceriel Jacobs
10 ; Version: $Id: par_misc.e,v 1.4 1994/06/24 13:33:28 ceriel Exp $
12 ; This has been taken from the ACK Modula-2 runtime system and adapted.
15 mes 2,EM_WSIZE,EM_PSIZE
18 ; ___topsave: save the stack by sending it to the debugger
41 lae 4 ; load line number and file name
43 lim ; load ignore mask
46 ; now find the last argument base: first find the local base that has
59 lpb ; last argument base
61 ; Now the stuff between the current stack pointer and this argument base
62 ; is saved by sending it to the debugger.
67 adu EM_WSIZE ; gives size
68 lor 1 ; SP (the SP BEFORE pushing)
69 lor 1 ; SP (address of stack top to save)
70 cal $___sendtop ; ___sendtop(char *address, char *SP, unsigned size)
71 asp 4*EM_PSIZE+3*EM_WSIZE ; remove the lot from the stack
73 ret EM_WSIZE ; return 1
109 loi EM_PSIZE ; compare target SP with current LB to see if we must
110 cmp ; find another LB first
112 dch ; just follow dynamic chain to make sure we find
125 cal $___restoretop ; ___restoretop(char *SP)
127 asp EM_PSIZE+EM_WSIZE
128 str 0 ; restore local base
132 ste 0 ; line and file
134 ret EM_WSIZE ; return 0