source: trunk/minix/lib/ack/libp/gto.e@ 10

Last change on this file since 10 was 9, checked in by Mattia Monga, 14 years ago

Minix 3.1.2a

File size: 1.8 KB
RevLine 
[9]1#
2; $Header: /cvsup/minix/src/lib/ack/libp/gto.e,v 1.1 2005/10/10 15:27:46 beng Exp $
3; (c) copyright 1983 by the Vrije Universiteit, Amsterdam, The Netherlands.
4;
5; This product is part of the Amsterdam Compiler Kit.
6;
7; Permission to use, sell, duplicate or disclose this software must be
8; obtained in writing. Requests for such permissions may be sent to
9;
10; Dr. Andrew S. Tanenbaum
11; Wiskundig Seminarium
12; Vrije Universiteit
13; Postbox 7161
14; 1007 MC Amsterdam
15; The Netherlands
16;
17
18/* Author: J.W. Stevenson */
19
20
21 mes 2,_EM_WSIZE,_EM_PSIZE
22
23#define TARLB 0
24#define DESCR _EM_PSIZE
25
26#define NEWPC 0
27#define SAVSP _EM_PSIZE
28
29#define D_PC 0
30#define D_SP _EM_PSIZE
31#define D_LB _EM_PSIZE+_EM_PSIZE
32
33#define LOCLB 0-_EM_PSIZE
34
35; _gto is called with two arguments:
36; - pointer to the label descriptor (DESCR)
37; - local base (LB) of target procedure (TARLB)
38; the label descriptor contains two items:
39; - label address i.e. new PC (NEWPC)
40; - offset in target procedure frame (SAVSP)
41; using this offset and the LB of the target procedure, the address of
42; of local variable of the target procedure is constructed.
43; the target procedure must have stored the correct target SP there.
44
45descr
46 bss 3*_EM_PSIZE,0,0
47
48 exp $_gto
49 pro $_gto,_EM_PSIZE
50 lal DESCR
51 loi _EM_PSIZE
52 adp NEWPC
53 loi _EM_PSIZE
54 lae descr+D_PC
55 sti _EM_PSIZE
56 lal TARLB
57 loi _EM_PSIZE
58 zer _EM_PSIZE
59 cmp
60 zeq *1
61 lal TARLB
62 loi _EM_PSIZE
63 bra *2
641
65 lae _m_lb
66 loi _EM_PSIZE
672
68 lal LOCLB
69 sti _EM_PSIZE
70 lal LOCLB
71 loi _EM_PSIZE
72 lal DESCR
73 loi _EM_PSIZE
74 adp SAVSP
75 loi _EM_WSIZE ; or _EM_PSIZE ?
76 ads _EM_WSIZE ; or _EM_PSIZE ?
77 loi _EM_PSIZE
78 lae descr+D_SP
79 sti _EM_PSIZE
80 lal LOCLB
81 loi _EM_PSIZE
82 lae descr+D_LB
83 sti _EM_PSIZE
84 gto descr
85 end ?
Note: See TracBrowser for help on using the repository browser.