Pristine Ack-5.5
[Ack-5.5.git] / lang / m2 / libm2 / head_m2.e
1 #
2 ;
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".
5 ;
6 ;
7 ; Module:       Modula-2 runtime startoff
8 ; Author:       Ceriel J.H. Jacobs
9 ; Version:      $Id: head_m2.e,v 1.14 1994/06/24 12:51:07 ceriel Exp $
10 ;
11
12  mes 2,EM_WSIZE,EM_PSIZE
13
14  exa handler
15  exa environ
16  exa argv
17  exa argc
18  exa MainLB
19  exa bkillbss
20  exp $catch
21  exp $init
22  inp $trap_handler
23
24 bkillbss
25  bss EM_PSIZE,0,0
26
27  exp $_m_a_i_n
28  pro $_m_a_i_n, 0
29
30  lor 0
31  lae MainLB
32  sti EM_PSIZE
33
34  lal EM_WSIZE+EM_PSIZE
35  loi EM_PSIZE
36  lae environ            ; save environment pointer
37  sti EM_PSIZE
38
39  lal EM_WSIZE
40  loi EM_PSIZE
41  lae argv               ; save argument pointer
42  sti EM_PSIZE
43
44  lol 0
45  ste argc               ; save argument count
46
47  lpi $trap_handler
48  sig
49  asp EM_PSIZE
50  cal $init
51  cal $__M2M_
52  cal $halt
53  loc 0                  ; should not get here
54  ret EM_WSIZE
55  end
56
57  pro $trap_handler,0
58  lpi $trap_handler
59  sig
60  lol 0  ; trap number
61  lae handler
62  loi EM_PSIZE
63  lpi $catch
64  lae handler
65  sti EM_PSIZE
66  cai
67  asp EM_PSIZE+EM_WSIZE
68  rtt
69  end 0
70