1987-05-13 14:36:45 +00:00
|
|
|
#
|
1988-02-19 15:54:01 +00:00
|
|
|
;
|
|
|
|
; (c) copyright 1988 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
|
|
|
; See the copyright notice in the ACK home directory, in the file "Copyright".
|
|
|
|
;
|
|
|
|
;
|
|
|
|
; Module: Modula-2 runtime startoff
|
|
|
|
; Author: Ceriel J.H. Jacobs
|
|
|
|
; Version: $Header$
|
|
|
|
;
|
1987-05-13 14:36:45 +00:00
|
|
|
|
|
|
|
mes 2,EM_WSIZE,EM_PSIZE
|
|
|
|
|
1987-07-09 15:15:22 +00:00
|
|
|
#define STACKSIZE 2048 /* maximum stack size for a coroutine */
|
1987-05-13 14:36:45 +00:00
|
|
|
|
1988-03-23 17:55:57 +00:00
|
|
|
exa handler
|
|
|
|
exa environ
|
|
|
|
exa argv
|
|
|
|
exa argc
|
|
|
|
exa CurrentProcess
|
|
|
|
exa MainProcess
|
|
|
|
exa StackBase
|
|
|
|
exa MainLB
|
|
|
|
exa StackSize
|
|
|
|
exp $catch
|
1988-04-29 14:38:36 +00:00
|
|
|
exp $init
|
1988-03-18 14:23:04 +00:00
|
|
|
inp $trap_handler
|
1987-05-13 14:36:45 +00:00
|
|
|
|
1988-03-23 17:55:57 +00:00
|
|
|
handler
|
|
|
|
con $catch
|
|
|
|
environ
|
1987-05-13 14:36:45 +00:00
|
|
|
bss EM_PSIZE,0,0
|
1988-03-23 17:55:57 +00:00
|
|
|
argv
|
1987-05-13 14:36:45 +00:00
|
|
|
bss EM_PSIZE,0,0
|
1988-03-23 17:55:57 +00:00
|
|
|
argc
|
1987-05-13 14:36:45 +00:00
|
|
|
bss EM_WSIZE,0,0
|
1988-03-23 17:55:57 +00:00
|
|
|
CurrentProcess
|
1987-05-13 14:36:45 +00:00
|
|
|
bss EM_PSIZE,0,0
|
1988-03-23 17:55:57 +00:00
|
|
|
MainProcess
|
1987-05-13 14:36:45 +00:00
|
|
|
bss EM_PSIZE,0,0
|
1988-03-23 17:55:57 +00:00
|
|
|
StackBase
|
1987-05-13 14:36:45 +00:00
|
|
|
bss EM_PSIZE,0,0
|
1988-03-23 17:55:57 +00:00
|
|
|
MainLB
|
1987-05-13 14:36:45 +00:00
|
|
|
bss EM_PSIZE,0,0
|
1988-03-23 17:55:57 +00:00
|
|
|
StackSize
|
1987-05-13 14:36:45 +00:00
|
|
|
bss EM_WSIZE,0,0
|
|
|
|
mainroutine
|
|
|
|
bss 2*EM_PSIZE,0,0
|
|
|
|
|
|
|
|
exp $m_a_i_n
|
|
|
|
pro $m_a_i_n, STACKSIZE
|
|
|
|
|
|
|
|
loc STACKSIZE
|
1988-03-23 17:55:57 +00:00
|
|
|
ste StackSize
|
1987-05-13 14:36:45 +00:00
|
|
|
|
|
|
|
lor 0
|
1988-03-23 17:55:57 +00:00
|
|
|
lae MainLB
|
1987-05-13 14:36:45 +00:00
|
|
|
sti EM_PSIZE
|
|
|
|
|
|
|
|
lal -EM_WSIZE
|
|
|
|
adp EM_WSIZE
|
1988-03-23 17:55:57 +00:00
|
|
|
lae StackBase
|
1987-05-13 14:36:45 +00:00
|
|
|
sti EM_PSIZE
|
|
|
|
|
|
|
|
lae mainroutine
|
|
|
|
adp 2*EM_PSIZE
|
|
|
|
dup EM_PSIZE
|
1988-03-23 17:55:57 +00:00
|
|
|
lae CurrentProcess
|
1987-05-13 14:36:45 +00:00
|
|
|
sti EM_PSIZE
|
1988-03-23 17:55:57 +00:00
|
|
|
lae MainProcess
|
1987-05-13 14:36:45 +00:00
|
|
|
sti EM_PSIZE
|
|
|
|
|
|
|
|
lal EM_WSIZE+EM_PSIZE
|
|
|
|
loi EM_PSIZE
|
1988-03-23 17:55:57 +00:00
|
|
|
lae environ ; save environment pointer
|
1987-05-13 14:36:45 +00:00
|
|
|
sti EM_PSIZE
|
|
|
|
|
|
|
|
lal EM_WSIZE
|
|
|
|
loi EM_PSIZE
|
1988-03-23 17:55:57 +00:00
|
|
|
lae argv ; save argument pointer
|
1987-05-13 14:36:45 +00:00
|
|
|
sti EM_PSIZE
|
|
|
|
|
|
|
|
lol 0
|
1988-03-23 17:55:57 +00:00
|
|
|
ste argc ; save argument count
|
1987-05-13 14:36:45 +00:00
|
|
|
|
1988-03-16 09:20:36 +00:00
|
|
|
lpi $trap_handler
|
1987-05-13 14:36:45 +00:00
|
|
|
sig
|
|
|
|
asp EM_PSIZE
|
1988-04-29 14:38:36 +00:00
|
|
|
cal $init
|
1988-03-23 17:55:57 +00:00
|
|
|
cal $__M2M_
|
|
|
|
cal $halt
|
1988-01-25 16:14:48 +00:00
|
|
|
loc 0 ; should not get here
|
1987-05-13 14:36:45 +00:00
|
|
|
ret EM_WSIZE
|
|
|
|
end
|
1988-03-18 14:23:04 +00:00
|
|
|
|
|
|
|
pro $trap_handler,0
|
1988-04-27 18:11:33 +00:00
|
|
|
lpi $trap_handler
|
|
|
|
sig
|
1988-03-18 14:23:04 +00:00
|
|
|
lol 0 ; trap number
|
1988-03-23 17:55:57 +00:00
|
|
|
lae handler
|
1988-03-18 14:23:04 +00:00
|
|
|
loi EM_PSIZE
|
1988-04-27 18:11:33 +00:00
|
|
|
lpi $catch
|
1988-04-29 14:38:36 +00:00
|
|
|
lae handler
|
1988-04-27 18:11:33 +00:00
|
|
|
sti EM_PSIZE
|
1988-03-18 14:23:04 +00:00
|
|
|
cai
|
|
|
|
asp EM_PSIZE+EM_WSIZE
|
|
|
|
rtt
|
|
|
|
end 0
|
|
|
|
|