annotate Idea @ 66:0b068058dd67

*** empty log message ***
author kono
date Sat, 22 Feb 2003 01:32:47 +0900 (2003-02-21)
parents eeca07d1b1c2
children 8a72b0afccfc
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
d35df41eac69 Initial revision
kono
parents:
diff changeset
1
d35df41eac69 Initial revision
kono
parents:
diff changeset
2 Thu Nov 25 17:27:12 JST 1999
d35df41eac69 Initial revision
kono
parents:
diff changeset
3
d35df41eac69 Initial revision
kono
parents:
diff changeset
4 subroutine call ���ʤ�
d35df41eac69 Initial revision
kono
parents:
diff changeset
5 �ɽ��ѿ���ʤ�
d35df41eac69 Initial revision
kono
parents:
diff changeset
6 �������ꡢ����ѿ���¿�Ѥ���
d35df41eac69 Initial revision
kono
parents:
diff changeset
7 ����ѿ��Υ������פ϶ɽ�Ū
d35df41eac69 Initial revision
kono
parents:
diff changeset
8 Fortran ���Ѥ˶ɽ��ѿ�����Ū�˼��
d35df41eac69 Initial revision
kono
parents:
diff changeset
9 recursion ������ˤϡ���ʬ����¸����
d35df41eac69 Initial revision
kono
parents:
diff changeset
10 subroutine call���Υ쥸�����Υ����֤�ɽ�Ū�˹Ԥ�
d35df41eac69 Initial revision
kono
parents:
diff changeset
11 ����ϡ�����ä��Ѥ���ʤ�?
d35df41eac69 Initial revision
kono
parents:
diff changeset
12 ��äѤ�ǥե���ȤΥե졼��ϻ����⤯��?
d35df41eac69 Initial revision
kono
parents:
diff changeset
13
d35df41eac69 Initial revision
kono
parents:
diff changeset
14 recursive call �Ȥ����Ǥʤ��Τ���̤��뤫?
d35df41eac69 Initial revision
kono
parents:
diff changeset
15
d35df41eac69 Initial revision
kono
parents:
diff changeset
16 fp ���Ѱդ��������ɤ�
d35df41eac69 Initial revision
kono
parents:
diff changeset
17
d35df41eac69 Initial revision
kono
parents:
diff changeset
18 �ؿ������Ʊ���ˡ��������Ѥ�fp�ι�¤�Τ��Ѱդ���
d35df41eac69 Initial revision
kono
parents:
diff changeset
19
d35df41eac69 Initial revision
kono
parents:
diff changeset
20 C ��compile������ˤϡ�stack������⤯
d35df41eac69 Initial revision
kono
parents:
diff changeset
21 fp = (struct func_state *)stack
d35df41eac69 Initial revision
kono
parents:
diff changeset
22 ���äȡ��ɤ������������? ������������⤢��櫓�͡�
d35df41eac69 Initial revision
kono
parents:
diff changeset
23 ���㤢��fp������? ����ϵ�������ʤ��ʡ�static
d35df41eac69 Initial revision
kono
parents:
diff changeset
24 ��fp�ˤ�����ɤ��櫓�͡�
d35df41eac69 Initial revision
kono
parents:
diff changeset
25
d35df41eac69 Initial revision
kono
parents:
diff changeset
26 func(void *stack) {
d35df41eac69 Initial revision
kono
parents:
diff changeset
27 static struct func_state {
d35df41eac69 Initial revision
kono
parents:
diff changeset
28 static struct func_state *fp;
d35df41eac69 Initial revision
kono
parents:
diff changeset
29 int local1;
d35df41eac69 Initial revision
kono
parents:
diff changeset
30 brahbrah...
d35df41eac69 Initial revision
kono
parents:
diff changeset
31 } func_state; // �����ޤ� hidden
d35df41eac69 Initial revision
kono
parents:
diff changeset
32 func_state.fp = (stack -= sizeof(struct func_state));
d35df41eac69 Initial revision
kono
parents:
diff changeset
33 }
d35df41eac69 Initial revision
kono
parents:
diff changeset
34
d35df41eac69 Initial revision
kono
parents:
diff changeset
35 func_state ��ȤäƤ���黻�Ҥ����ä������ɤ�? �����͡�
d35df41eac69 Initial revision
kono
parents:
diff changeset
36 func.state
d35df41eac69 Initial revision
kono
parents:
diff changeset
37 ���餤?
d35df41eac69 Initial revision
kono
parents:
diff changeset
38
d35df41eac69 Initial revision
kono
parents:
diff changeset
39 fp->local1 �ߤ����ʤ��Ȥ�������ʤ顢C ��Ʊ���ˤʤ롣
d35df41eac69 Initial revision
kono
parents:
diff changeset
40
d35df41eac69 Initial revision
kono
parents:
diff changeset
41 call �������arguemnt �⡢
d35df41eac69 Initial revision
kono
parents:
diff changeset
42 static �� func_state ���֤�
d35df41eac69 Initial revision
kono
parents:
diff changeset
43 stack ��� func_state ���֤�
d35df41eac69 Initial revision
kono
parents:
diff changeset
44 �Ȥ������̤������褬���롣C�ȸߴ��ʤ顢��������ԡ�
d35df41eac69 Initial revision
kono
parents:
diff changeset
45
d35df41eac69 Initial revision
kono
parents:
diff changeset
46 Recursive �ʤ��Ԥ��������θ���Ͼ������ܤ򵭽Ҥ��뤫�顢static
d35df41eac69 Initial revision
kono
parents:
diff changeset
47 �ʤ�ΤǤ��ɤ��Ϥ���
d35df41eac69 Initial revision
kono
parents:
diff changeset
48
d35df41eac69 Initial revision
kono
parents:
diff changeset
49 Internal function ��? ���äƤ⤤���������...
d35df41eac69 Initial revision
kono
parents:
diff changeset
50
d35df41eac69 Initial revision
kono
parents:
diff changeset
51 Recursive call ������ˤϡ� fp ��save����ɬ�פ�����͡�
d35df41eac69 Initial revision
kono
parents:
diff changeset
52 (--(struct func_state *)stack) = fp;
d35df41eac69 Initial revision
kono
parents:
diff changeset
53 call callee(&fp->arg,continuation,stack);
d35df41eac69 Initial revision
kono
parents:
diff changeset
54 call ���Ƥ⡢��ä���ʤ�����... continuation �ϰ���Ū�ˤ�code
d35df41eac69 Initial revision
kono
parents:
diff changeset
55 ������... ����� Internal function �ˤ��뤫��
d35df41eac69 Initial revision
kono
parents:
diff changeset
56
d35df41eac69 Initial revision
kono
parents:
diff changeset
57 continuation �˰���Ū��compile������ˡ��ͤ��ʤ��Ȥ����ʤ�����
d35df41eac69 Initial revision
kono
parents:
diff changeset
58 self ��ɬ�פʤ櫓��?
d35df41eac69 Initial revision
kono
parents:
diff changeset
59
d35df41eac69 Initial revision
kono
parents:
diff changeset
60 �����̾����ͤ��ʤ��Ȥ�����ʤ���
d35df41eac69 Initial revision
kono
parents:
diff changeset
61
d35df41eac69 Initial revision
kono
parents:
diff changeset
62 C ����Υ���ѥ����񤫤ʤ��Ȥ����ʤ��Τ�...
d35df41eac69 Initial revision
kono
parents:
diff changeset
63
d35df41eac69 Initial revision
kono
parents:
diff changeset
64 Mon Dec 13 18:53:04 JST 1999
d35df41eac69 Initial revision
kono
parents:
diff changeset
65
d35df41eac69 Initial revision
kono
parents:
diff changeset
66 compiler based �ǡ������� partial evaluation �Ǥ���?
d35df41eac69 Initial revision
kono
parents:
diff changeset
67
d35df41eac69 Initial revision
kono
parents:
diff changeset
68 func ��database�Ȥ��ư����ʤ��ʤ顢����ϤǤ��ʤ���
d35df41eac69 Initial revision
kono
parents:
diff changeset
69
d35df41eac69 Initial revision
kono
parents:
diff changeset
70 ���������������ܤȤ��Ƥϼ�갷���롣
d35df41eac69 Initial revision
kono
parents:
diff changeset
71
d35df41eac69 Initial revision
kono
parents:
diff changeset
72 func.state
d35df41eac69 Initial revision
kono
parents:
diff changeset
73 func.code
d35df41eac69 Initial revision
kono
parents:
diff changeset
74
d35df41eac69 Initial revision
kono
parents:
diff changeset
75 �ߤ����ʷ��ˤ���partial evaluation������ɤ�
d35df41eac69 Initial revision
kono
parents:
diff changeset
76
d35df41eac69 Initial revision
kono
parents:
diff changeset
77 �Ǥ�ߤޤ�Τ�?
d35df41eac69 Initial revision
kono
parents:
diff changeset
78
d35df41eac69 Initial revision
kono
parents:
diff changeset
79 textual �Ǥʤ������Ū�ʥ�����ɽ�������ä������ɤ�? <-> interpreter?
d35df41eac69 Initial revision
kono
parents:
diff changeset
80
d35df41eac69 Initial revision
kono
parents:
diff changeset
81 Prolog �ǤϤʤ�Ǥ����ʤ���? --> Unification ���Ť�����
d35df41eac69 Initial revision
kono
parents:
diff changeset
82
d35df41eac69 Initial revision
kono
parents:
diff changeset
83 Sat Nov 27 13:50:41 JST 1999
d35df41eac69 Initial revision
kono
parents:
diff changeset
84
d35df41eac69 Initial revision
kono
parents:
diff changeset
85 func.state �Ȥ����Τ��ä��顢
d35df41eac69 Initial revision
kono
parents:
diff changeset
86 struct {
d35df41eac69 Initial revision
kono
parents:
diff changeset
87 struct {
d35df41eac69 Initial revision
kono
parents:
diff changeset
88 int i;
d35df41eac69 Initial revision
kono
parents:
diff changeset
89 } state;
d35df41eac69 Initial revision
kono
parents:
diff changeset
90 state *code = {
d35df41eac69 Initial revision
kono
parents:
diff changeset
91 i = i+1;
d35df41eac69 Initial revision
kono
parents:
diff changeset
92 };
d35df41eac69 Initial revision
kono
parents:
diff changeset
93 } name;
d35df41eac69 Initial revision
kono
parents:
diff changeset
94 �ߤ����ʷ��ǡ����켫�Τ�¤�������? �ǡ������������ʬɾ������롣
d35df41eac69 Initial revision
kono
parents:
diff changeset
95 �������ǽ���ʤ�ۤɡ�
d35df41eac69 Initial revision
kono
parents:
diff changeset
96 *name.code;
d35df41eac69 Initial revision
kono
parents:
diff changeset
97 �ͤϤ���櫓? �ͤ� &state �Ǥ��礦�͡�
d35df41eac69 Initial revision
kono
parents:
diff changeset
98 self �������
d35df41eac69 Initial revision
kono
parents:
diff changeset
99 struct {
d35df41eac69 Initial revision
kono
parents:
diff changeset
100 struct {
d35df41eac69 Initial revision
kono
parents:
diff changeset
101 int i;
d35df41eac69 Initial revision
kono
parents:
diff changeset
102 } state,
d35df41eac69 Initial revision
kono
parents:
diff changeset
103 *code = {
d35df41eac69 Initial revision
kono
parents:
diff changeset
104 self->i = self->i+1;
d35df41eac69 Initial revision
kono
parents:
diff changeset
105 };
d35df41eac69 Initial revision
kono
parents:
diff changeset
106 } name;
d35df41eac69 Initial revision
kono
parents:
diff changeset
107 ���ʡ�self = state ����͡�
d35df41eac69 Initial revision
kono
parents:
diff changeset
108
d35df41eac69 Initial revision
kono
parents:
diff changeset
109 union �γ�ĥ�⤢�碌�Ƶ��������...
d35df41eac69 Initial revision
kono
parents:
diff changeset
110
d35df41eac69 Initial revision
kono
parents:
diff changeset
111 Partial evalutator �򥻥ޥ�ƥ�������¹ԷϤˤ���Ƥ������Ȥϲ�ǽ��?
d35df41eac69 Initial revision
kono
parents:
diff changeset
112
d35df41eac69 Initial revision
kono
parents:
diff changeset
113 byte code �Ȥ����ۥޥ�����ä����ǽ�������Ǥʤ�����?
d35df41eac69 Initial revision
kono
parents:
diff changeset
114
d35df41eac69 Initial revision
kono
parents:
diff changeset
115 ������ˤ��衢��¤�ΤΥ�����unique���������ʤ��Ȥ�����ʡ�
d35df41eac69 Initial revision
kono
parents:
diff changeset
116
d35df41eac69 Initial revision
kono
parents:
diff changeset
117 �إå��ե�����Ϥɤ������?
d35df41eac69 Initial revision
kono
parents:
diff changeset
118
d35df41eac69 Initial revision
kono
parents:
diff changeset
119 Mon Dec 13 18:53:18 JST 1999
d35df41eac69 Initial revision
kono
parents:
diff changeset
120
d35df41eac69 Initial revision
kono
parents:
diff changeset
121 library �Ȥ���������?
d35df41eac69 Initial revision
kono
parents:
diff changeset
122
d35df41eac69 Initial revision
kono
parents:
diff changeset
123 exec sequence �Ǥϡ�
d35df41eac69 Initial revision
kono
parents:
diff changeset
124 (--(struct func_state *)stack) = fp;
d35df41eac69 Initial revision
kono
parents:
diff changeset
125 call callee(&fp->arg);
d35df41eac69 Initial revision
kono
parents:
diff changeset
126 �Ȥ�������pointer�����Ϥ���? ������Ѥ���͡�
d35df41eac69 Initial revision
kono
parents:
diff changeset
127
d35df41eac69 Initial revision
kono
parents:
diff changeset
128 ���Ϥ��ˤ���Ȥ���С�ʣ�����ͤ��Ϥ����ۤ����ɤ���
d35df41eac69 Initial revision
kono
parents:
diff changeset
129
d35df41eac69 Initial revision
kono
parents:
diff changeset
130 func(void *stack) {
d35df41eac69 Initial revision
kono
parents:
diff changeset
131 static struct func_state {
d35df41eac69 Initial revision
kono
parents:
diff changeset
132 static struct func_state *fp;
d35df41eac69 Initial revision
kono
parents:
diff changeset
133 int local1;
d35df41eac69 Initial revision
kono
parents:
diff changeset
134 brahbrah...
d35df41eac69 Initial revision
kono
parents:
diff changeset
135 } func_state; // �����ޤ� hidden
d35df41eac69 Initial revision
kono
parents:
diff changeset
136 func_state.fp = (stack -= sizeof(struct func_state));
d35df41eac69 Initial revision
kono
parents:
diff changeset
137 }
d35df41eac69 Initial revision
kono
parents:
diff changeset
138
d35df41eac69 Initial revision
kono
parents:
diff changeset
139 �ΰ������Τ�����¤�ΤǤ���٤���
d35df41eac69 Initial revision
kono
parents:
diff changeset
140
d35df41eac69 Initial revision
kono
parents:
diff changeset
141 func(
d35df41eac69 Initial revision
kono
parents:
diff changeset
142 struct void *stack
d35df41eac69 Initial revision
kono
parents:
diff changeset
143 ) {
d35df41eac69 Initial revision
kono
parents:
diff changeset
144 static struct func_state {
d35df41eac69 Initial revision
kono
parents:
diff changeset
145 static struct func_state *fp;
d35df41eac69 Initial revision
kono
parents:
diff changeset
146 int local1;
d35df41eac69 Initial revision
kono
parents:
diff changeset
147 brahbrah...
d35df41eac69 Initial revision
kono
parents:
diff changeset
148 } func_state; // �����ޤ� hidden
d35df41eac69 Initial revision
kono
parents:
diff changeset
149 func_state.fp = (stack -= sizeof(struct func_state));
d35df41eac69 Initial revision
kono
parents:
diff changeset
150 }
d35df41eac69 Initial revision
kono
parents:
diff changeset
151
d35df41eac69 Initial revision
kono
parents:
diff changeset
152 �ǡ���¤�Τ� register storage �������
d35df41eac69 Initial revision
kono
parents:
diff changeset
153
d35df41eac69 Initial revision
kono
parents:
diff changeset
154 func(
d35df41eac69 Initial revision
kono
parents:
diff changeset
155 static struct argment {
d35df41eac69 Initial revision
kono
parents:
diff changeset
156 register void *stack;
d35df41eac69 Initial revision
kono
parents:
diff changeset
157 register void *continuation;
d35df41eac69 Initial revision
kono
parents:
diff changeset
158 }
d35df41eac69 Initial revision
kono
parents:
diff changeset
159 ) {
d35df41eac69 Initial revision
kono
parents:
diff changeset
160 static struct func_state {
d35df41eac69 Initial revision
kono
parents:
diff changeset
161 static struct func_state *fp;
d35df41eac69 Initial revision
kono
parents:
diff changeset
162 int local1;
d35df41eac69 Initial revision
kono
parents:
diff changeset
163 brahbrah...
d35df41eac69 Initial revision
kono
parents:
diff changeset
164 } func_state; // �����ޤ� hidden
d35df41eac69 Initial revision
kono
parents:
diff changeset
165 func_state.fp = (stack -= sizeof(struct func_state));
d35df41eac69 Initial revision
kono
parents:
diff changeset
166 }
d35df41eac69 Initial revision
kono
parents:
diff changeset
167
d35df41eac69 Initial revision
kono
parents:
diff changeset
168 ����ȡ�caller �����⡢��¤�Τ�����Ȥ���Τ�������
d35df41eac69 Initial revision
kono
parents:
diff changeset
169
d35df41eac69 Initial revision
kono
parents:
diff changeset
170 call caller(
d35df41eac69 Initial revision
kono
parents:
diff changeset
171 static struct argment {
d35df41eac69 Initial revision
kono
parents:
diff changeset
172 register void *stack;
d35df41eac69 Initial revision
kono
parents:
diff changeset
173 register void *continuation;
d35df41eac69 Initial revision
kono
parents:
diff changeset
174 } arg = {a,b};
d35df41eac69 Initial revision
kono
parents:
diff changeset
175 )
d35df41eac69 Initial revision
kono
parents:
diff changeset
176
d35df41eac69 Initial revision
kono
parents:
diff changeset
177 �ߤ����ʡ�������󡢤��ι�¤�Τϥ��󥿥ե������ȸƤФ�롣
d35df41eac69 Initial revision
kono
parents:
diff changeset
178
d35df41eac69 Initial revision
kono
parents:
diff changeset
179 argument �ϡ�callee �ˤ��ä������ɤ����ɡ�caller ¦�ˤ��äƤ�
d35df41eac69 Initial revision
kono
parents:
diff changeset
180 �ɤ���register �ʤ󤫤ϡ�������
d35df41eac69 Initial revision
kono
parents:
diff changeset
181
d35df41eac69 Initial revision
kono
parents:
diff changeset
182 caller(interface caller_arg = {a,b,c})
d35df41eac69 Initial revision
kono
parents:
diff changeset
183 �ߤ�����syntax ���ʡ�
d35df41eac69 Initial revision
kono
parents:
diff changeset
184 caller->interface = {a,b,c};
d35df41eac69 Initial revision
kono
parents:
diff changeset
185 *caller->code;
d35df41eac69 Initial revision
kono
parents:
diff changeset
186 ��
d35df41eac69 Initial revision
kono
parents:
diff changeset
187 caller(a,b,c);
d35df41eac69 Initial revision
kono
parents:
diff changeset
188 �ȾΤ��롣
d35df41eac69 Initial revision
kono
parents:
diff changeset
189
d35df41eac69 Initial revision
kono
parents:
diff changeset
190 function �ˤϡ�interface �� code �� state �����뤳�Ȥˤʤ롣
d35df41eac69 Initial revision
kono
parents:
diff changeset
191
d35df41eac69 Initial revision
kono
parents:
diff changeset
192 state �˥��������������lock��? protected state? synchonized state ����?
d35df41eac69 Initial revision
kono
parents:
diff changeset
193 �������sequential implementatoin�Ǥϡ�����ʤ�ΤϤ���ʤ���
d35df41eac69 Initial revision
kono
parents:
diff changeset
194
d35df41eac69 Initial revision
kono
parents:
diff changeset
195 function {
d35df41eac69 Initial revision
kono
parents:
diff changeset
196 interface:
d35df41eac69 Initial revision
kono
parents:
diff changeset
197 register int a;
d35df41eac69 Initial revision
kono
parents:
diff changeset
198 register struct self self;
d35df41eac69 Initial revision
kono
parents:
diff changeset
199 state:
d35df41eac69 Initial revision
kono
parents:
diff changeset
200 int b;
d35df41eac69 Initial revision
kono
parents:
diff changeset
201 serialized int c;
d35df41eac69 Initial revision
kono
parents:
diff changeset
202 code:
d35df41eac69 Initial revision
kono
parents:
diff changeset
203 b = a;
d35df41eac69 Initial revision
kono
parents:
diff changeset
204 }
d35df41eac69 Initial revision
kono
parents:
diff changeset
205
d35df41eac69 Initial revision
kono
parents:
diff changeset
206 int ��void value ��������롣�����ϽŤ��ʤ뤱��...
d35df41eac69 Initial revision
kono
parents:
diff changeset
207
d35df41eac69 Initial revision
kono
parents:
diff changeset
208 serialzed �� semantics ��?
d35df41eac69 Initial revision
kono
parents:
diff changeset
209
d35df41eac69 Initial revision
kono
parents:
diff changeset
210 �⤦����micro-C�˶᤯!
d35df41eac69 Initial revision
kono
parents:
diff changeset
211
d35df41eac69 Initial revision
kono
parents:
diff changeset
212 carring state �� static state��
d35df41eac69 Initial revision
kono
parents:
diff changeset
213
d35df41eac69 Initial revision
kono
parents:
diff changeset
214 Mon Dec 13 19:42:41 JST 1999
d35df41eac69 Initial revision
kono
parents:
diff changeset
215
d35df41eac69 Initial revision
kono
parents:
diff changeset
216 interface �� regsiter keyword ��Ȥ��Τϡ����ޤ��
d35df41eac69 Initial revision
kono
parents:
diff changeset
217 ������ꤹ���롣�Ǥ⡢�Ǥʤ��Ⱦ��֤ˤǤ��ʤ�?
d35df41eac69 Initial revision
kono
parents:
diff changeset
218 ����ʤ��ȤϤʤ�������äѤ�caller¦��static �ΰ��
d35df41eac69 Initial revision
kono
parents:
diff changeset
219 ľ�ܽ񤭹���?
d35df41eac69 Initial revision
kono
parents:
diff changeset
220
d35df41eac69 Initial revision
kono
parents:
diff changeset
221 ����C����٤������Ǥ⡢������40�ĤȤ������줿��...
d35df41eac69 Initial revision
kono
parents:
diff changeset
222
d35df41eac69 Initial revision
kono
parents:
diff changeset
223 Wed Dec 15 14:09:49 JST 1999
d35df41eac69 Initial revision
kono
parents:
diff changeset
224
d35df41eac69 Initial revision
kono
parents:
diff changeset
225 C �ȸߴ��ˤ���?
d35df41eac69 Initial revision
kono
parents:
diff changeset
226 goto function(argments);
d35df41eac69 Initial revision
kono
parents:
diff changeset
227 goto *continuation(argments);
d35df41eac69 Initial revision
kono
parents:
diff changeset
228 �ߤ����ʴ����ǡ�
d35df41eac69 Initial revision
kono
parents:
diff changeset
229
d35df41eac69 Initial revision
kono
parents:
diff changeset
230 stack�δ�����? �ɤ�����library �Ȥθߴ��ϤȤ�ʤ���
d35df41eac69 Initial revision
kono
parents:
diff changeset
231 �����ʤ��������...
d35df41eac69 Initial revision
kono
parents:
diff changeset
232
d35df41eac69 Initial revision
kono
parents:
diff changeset
233 local �ѿ���������� stack ��ư�������Ǥ⡢�᤹�ۤ����ʤ���
d35df41eac69 Initial revision
kono
parents:
diff changeset
234 closure �����뤫?
d35df41eac69 Initial revision
kono
parents:
diff changeset
235
d35df41eac69 Initial revision
kono
parents:
diff changeset
236 return �������ε�ư��ʣ���ˤʤ롣���return����櫓���顣
d35df41eac69 Initial revision
kono
parents:
diff changeset
237
d35df41eac69 Initial revision
kono
parents:
diff changeset
238 argments ��static �ΰ�ˤ��������������ȸߴ������Ȥ�ʤ���
d35df41eac69 Initial revision
kono
parents:
diff changeset
239 stack ��� frmae pointer ��ˤʤ��ȥ�������顣
d35df41eac69 Initial revision
kono
parents:
diff changeset
240
d35df41eac69 Initial revision
kono
parents:
diff changeset
241 ξΩ������Τ�̵����? �Ĥޤꡢ������ȡ��ƤӽФ��줿����
d35df41eac69 Initial revision
kono
parents:
diff changeset
242 frame semantics �ϡ�C �ȸߴ��ˤʤ롣�����顢stack��ľ���
d35df41eac69 Initial revision
kono
parents:
diff changeset
243 frame pointer ������ȻפäƤ��� (������? ) frame pointer
d35df41eac69 Initial revision
kono
parents:
diff changeset
244 stack pointer �˱�äư�ư����ľ��ˡ����������offset
d35df41eac69 Initial revision
kono
parents:
diff changeset
245 �ǰ��������뤳�Ȥˤʤ롣
d35df41eac69 Initial revision
kono
parents:
diff changeset
246
d35df41eac69 Initial revision
kono
parents:
diff changeset
247 �Ĥޤꡢ����Ϥ�����ä����Ȥ���ʤ�? �Ĥޤꡢgoto ���ȡ�
d35df41eac69 Initial revision
kono
parents:
diff changeset
248 frame pointer �ϡ�stack ��ľ��Ȥϸ¤�ʤ����顣����
d35df41eac69 Initial revision
kono
parents:
diff changeset
249 frmae pointer ���Ф˰����˥����������Ƥ������̤����ɤ͡�
d35df41eac69 Initial revision
kono
parents:
diff changeset
250
d35df41eac69 Initial revision
kono
parents:
diff changeset
251 stack �˰������Ѥ�Τ���ǧ���ơ�goto �ξ��ϡ�������¦��
d35df41eac69 Initial revision
kono
parents:
diff changeset
252 stack �����äƤΤ�? �Ȥ������Ȥϡ����̤δؿ��������
d35df41eac69 Initial revision
kono
parents:
diff changeset
253 ��ˡ���Ѥ���äƤ��Ȥ����ޡ������Ϥʤ�����
d35df41eac69 Initial revision
kono
parents:
diff changeset
254
d35df41eac69 Initial revision
kono
parents:
diff changeset
255 ����ȡ�goto ��semantics �ϡ�C �ȸߴ��ˤʤ롣����������
d35df41eac69 Initial revision
kono
parents:
diff changeset
256 �����ۤʤ뤳�Ȥ򤹤롣����ϡ��ʤ󤫤��������ʡ�����ˡ�
d35df41eac69 Initial revision
kono
parents:
diff changeset
257 ������ȴؿ��ƤӽФ����ڤ��ʤ�ʤ�...
d35df41eac69 Initial revision
kono
parents:
diff changeset
258
d35df41eac69 Initial revision
kono
parents:
diff changeset
259 �Ȥ������Ȥϡ���ϤꡢC ��call �ϡ�call funciton ��
d35df41eac69 Initial revision
kono
parents:
diff changeset
260 �¸����ơ�����¾�θƤӽФ��ϡ����٤ơ�goto ������
d35df41eac69 Initial revision
kono
parents:
diff changeset
261 ����������������������
d35df41eac69 Initial revision
kono
parents:
diff changeset
262
d35df41eac69 Initial revision
kono
parents:
diff changeset
263 ����ϡ����θ���δؿ���call���줿�����ʡ�dual entry �ˤ��ơ�
d35df41eac69 Initial revision
kono
parents:
diff changeset
264 call �λ��ȡ�goto �λ�����̤��뤫��
d35df41eac69 Initial revision
kono
parents:
diff changeset
265 func: stack processing
d35df41eac69 Initial revision
kono
parents:
diff changeset
266 func_goto: normal processing
d35df41eac69 Initial revision
kono
parents:
diff changeset
267 ...
d35df41eac69 Initial revision
kono
parents:
diff changeset
268 �ߤ����ʴ������Ǥ⡢return �Ϥʤ�����...
d35df41eac69 Initial revision
kono
parents:
diff changeset
269
d35df41eac69 Initial revision
kono
parents:
diff changeset
270 ���Τ�����⼫ʬ�ǵ��ҤǤ������Ǥ���٤�����͡������̤ꡣ
d35df41eac69 Initial revision
kono
parents:
diff changeset
271 �ĤޤꡢC �Ȥ�stub �⼫ʬ�ǵ��Ҥ���ȸ������Ȥ���
d35df41eac69 Initial revision
kono
parents:
diff changeset
272
d35df41eac69 Initial revision
kono
parents:
diff changeset
273 protocol function {
d35df41eac69 Initial revision
kono
parents:
diff changeset
274 interface c {
d35df41eac69 Initial revision
kono
parents:
diff changeset
275 register "%esp" struct {
d35df41eac69 Initial revision
kono
parents:
diff changeset
276 entry code ret(int);
d35df41eac69 Initial revision
kono
parents:
diff changeset
277 void *fp;
d35df41eac69 Initial revision
kono
parents:
diff changeset
278 } *sp;
d35df41eac69 Initial revision
kono
parents:
diff changeset
279 register "%ebp" void *fp;
d35df41eac69 Initial revision
kono
parents:
diff changeset
280 };
d35df41eac69 Initial revision
kono
parents:
diff changeset
281 code function_code {
d35df41eac69 Initial revision
kono
parents:
diff changeset
282 fp = sp;
d35df41eac69 Initial revision
kono
parents:
diff changeset
283 sp += sizeof(struct local);
d35df41eac69 Initial revision
kono
parents:
diff changeset
284 struct local *local = sp;
d35df41eac69 Initial revision
kono
parents:
diff changeset
285
d35df41eac69 Initial revision
kono
parents:
diff changeset
286 local->i = 1;
d35df41eac69 Initial revision
kono
parents:
diff changeset
287 goto *fp->ret(local->i),sp=fp; // return(local->i);
d35df41eac69 Initial revision
kono
parents:
diff changeset
288 };
d35df41eac69 Initial revision
kono
parents:
diff changeset
289 }
d35df41eac69 Initial revision
kono
parents:
diff changeset
290
d35df41eac69 Initial revision
kono
parents:
diff changeset
291 �ߤ����ʴ����Ǥ������ä�����������֥顣���ޤ���return���������ɡ�
d35df41eac69 Initial revision
kono
parents:
diff changeset
292 �ޤ���return �Ϥ��Τޤ�return�Ǥ⤤�����ɤ���
d35df41eac69 Initial revision
kono
parents:
diff changeset
293
d35df41eac69 Initial revision
kono
parents:
diff changeset
294 ����������ɤ������Τ�ʤ���code ��ʣ�������뤫�顣
d35df41eac69 Initial revision
kono
parents:
diff changeset
295
d35df41eac69 Initial revision
kono
parents:
diff changeset
296 state �ʳ��ϡ�consitent state �Ǥ��뤳�Ȥ��ݾڤ��ʤ����äƤΤ�?
d35df41eac69 Initial revision
kono
parents:
diff changeset
297 local �ѿ��ϻȤäƤ��ɤ����ɡ�call/goto ������ǡ��ͤ��ݾڤ��ʤ���...
d35df41eac69 Initial revision
kono
parents:
diff changeset
298
d35df41eac69 Initial revision
kono
parents:
diff changeset
299 �����󡢤�������������Ƥ�ʤ���
d35df41eac69 Initial revision
kono
parents:
diff changeset
300
d35df41eac69 Initial revision
kono
parents:
diff changeset
301 �����顢�쥸�������Ф���ޥåԥ󥰤ε��Ҥȡ������Ǥʤ���ʬ��
d35df41eac69 Initial revision
kono
parents:
diff changeset
302 ���Ҥ�ʬΥ����٤��Ǥ��礦�͡�
d35df41eac69 Initial revision
kono
parents:
diff changeset
303
d35df41eac69 Initial revision
kono
parents:
diff changeset
304
d35df41eac69 Initial revision
kono
parents:
diff changeset
305 �������դ˼�������櫓�ˤϤ����ʤ����餡...
d35df41eac69 Initial revision
kono
parents:
diff changeset
306
d35df41eac69 Initial revision
kono
parents:
diff changeset
307 Thu Dec 16 13:44:21 JST 1999
d35df41eac69 Initial revision
kono
parents:
diff changeset
308
d35df41eac69 Initial revision
kono
parents:
diff changeset
309 lock �Ͼ������ܥ�٥�Ǽ¸�����Τ����顢self �ʤɤ�
d35df41eac69 Initial revision
kono
parents:
diff changeset
310 �Ȥä�lock����ɬ�פϤʤ��Ϥ���
d35df41eac69 Initial revision
kono
parents:
diff changeset
311
d35df41eac69 Initial revision
kono
parents:
diff changeset
312 ���Τ�ľ�󲽤ϡ��������ܥ�٥�ǡ�
d35df41eac69 Initial revision
kono
parents:
diff changeset
313 lock(storage) -> transition
d35df41eac69 Initial revision
kono
parents:
diff changeset
314 �ߤ����ʷ��ǵ��Ҥ�����ɤ�������������򡢤ɤΤ褦�˵��Ҥ��뤫��
d35df41eac69 Initial revision
kono
parents:
diff changeset
315 �⤦���������ꤷ�褦��
d35df41eac69 Initial revision
kono
parents:
diff changeset
316
d35df41eac69 Initial revision
kono
parents:
diff changeset
317
d35df41eac69 Initial revision
kono
parents:
diff changeset
318 �����ϥ쥸�����Ϥ��ˤ��褦��Ĺ�������ϡ��ƤӽФ�¦���ΰ�ؤ�
d35df41eac69 Initial revision
kono
parents:
diff changeset
319 �ݥ��󥿤Ȥ��롣�������ꤷ�Ƥ��ɤ�����������С�varargs
d35df41eac69 Initial revision
kono
parents:
diff changeset
320 �ߤ����ʤ�ΤϤʤ��ʤ롣�����������ʤ�ǡ�����ʤ�Τ�����������?
d35df41eac69 Initial revision
kono
parents:
diff changeset
321 ������Ϥ��Ф��������
d35df41eac69 Initial revision
kono
parents:
diff changeset
322
d35df41eac69 Initial revision
kono
parents:
diff changeset
323 �ʤΤǡ������ϰ��(or ���)�˸¤�Ȥ�����ˡ�⤢�롣
d35df41eac69 Initial revision
kono
parents:
diff changeset
324
d35df41eac69 Initial revision
kono
parents:
diff changeset
325 �Ȥ���ȡ���Ϥꡢ����ä���Ū�ΰ��ưŪ�ΰ����ݤ��뤳�Ȥ�
d35df41eac69 Initial revision
kono
parents:
diff changeset
326 �Ǥ��ʤ���
d35df41eac69 Initial revision
kono
parents:
diff changeset
327
d35df41eac69 Initial revision
kono
parents:
diff changeset
328 ���θ���Ǥ�ưŪ�ΰ�ϼ�ʬ�dz��ݤ���櫓�����顢������������ʤ���
d35df41eac69 Initial revision
kono
parents:
diff changeset
329
d35df41eac69 Initial revision
kono
parents:
diff changeset
330 Thu Dec 16 20:24:55 JST 1999
d35df41eac69 Initial revision
kono
parents:
diff changeset
331
d35df41eac69 Initial revision
kono
parents:
diff changeset
332 �Ȥ���ȴؿ��ƤӽФ��ϡ�
d35df41eac69 Initial revision
kono
parents:
diff changeset
333 # register save
d35df41eac69 Initial revision
kono
parents:
diff changeset
334 # set 1st argument in register %eax
d35df41eac69 Initial revision
kono
parents:
diff changeset
335 # set 2nd argument in register %ecx
d35df41eac69 Initial revision
kono
parents:
diff changeset
336 # set extra aguments in save area
d35df41eac69 Initial revision
kono
parents:
diff changeset
337 # set extra argument pointer in %edx
d35df41eac69 Initial revision
kono
parents:
diff changeset
338 jmp function
d35df41eac69 Initial revision
kono
parents:
diff changeset
339 �Ȥ��������ˤʤ�櫓�͡�second ���������ΤϤ��ɤ�����������
d35df41eac69 Initial revision
kono
parents:
diff changeset
340 �ˤ��褦��
d35df41eac69 Initial revision
kono
parents:
diff changeset
341
d35df41eac69 Initial revision
kono
parents:
diff changeset
342 �����ȡ�frame pointer �Ϥʤ����ɡ�����ѥ���μ�礫�餹���
d35df41eac69 Initial revision
kono
parents:
diff changeset
343 ���ä������ɤ�����������frame pointer ���Τ�Τ�static
d35df41eac69 Initial revision
kono
parents:
diff changeset
344 �ˤȤ�ΤϤޤ����������顢frame pointer ��first argment
d35df41eac69 Initial revision
kono
parents:
diff changeset
345 �Ȥ������Ȥˤ����������������Ȥ���Ȱ����ϡ�����ˡ�����
d35df41eac69 Initial revision
kono
parents:
diff changeset
346 ��ȸ����櫓����
d35df41eac69 Initial revision
kono
parents:
diff changeset
347 f(fp,argment)
d35df41eac69 Initial revision
kono
parents:
diff changeset
348 fp ���Ϥ��Τˤ����argment ��쥸�������Ϥ��ΤϤ��������������������ɡ�
d35df41eac69 Initial revision
kono
parents:
diff changeset
349 �ޡ��ɤ�����
d35df41eac69 Initial revision
kono
parents:
diff changeset
350
d35df41eac69 Initial revision
kono
parents:
diff changeset
351 return ���ʤ��ʤ顢return type �������Ȥ�Τ��Ѥ��ʡ�
d35df41eac69 Initial revision
kono
parents:
diff changeset
352
d35df41eac69 Initial revision
kono
parents:
diff changeset
353 f(fp,arg1,arg2,arg3) �Ȥ���ȡ����줾�줬��ޤä��쥸���������äơ�
d35df41eac69 Initial revision
kono
parents:
diff changeset
354 ¿��ʬ������ˤ���Ȼפ��롣�դ�դ�...
d35df41eac69 Initial revision
kono
parents:
diff changeset
355 fp->xx
d35df41eac69 Initial revision
kono
parents:
diff changeset
356 �ǥ�����������С����Τޤ޶ɽ��ѿ��ˤʤ롣�����������
d35df41eac69 Initial revision
kono
parents:
diff changeset
357 ���äƤ��ɤ���
d35df41eac69 Initial revision
kono
parents:
diff changeset
358
d35df41eac69 Initial revision
kono
parents:
diff changeset
359 .set label,value
d35df41eac69 Initial revision
kono
parents:
diff changeset
360
d35df41eac69 Initial revision
kono
parents:
diff changeset
361 �� as ���ͤ򥻥åȤ���褦�Ǥ��͡�
d35df41eac69 Initial revision
kono
parents:
diff changeset
362
d35df41eac69 Initial revision
kono
parents:
diff changeset
363 �ؿ�������θ����ä���ʤ����������ο��ۤϤ��ʤ��Ƥ褤��
d35df41eac69 Initial revision
kono
parents:
diff changeset
364 frame pointer ��Ȥä��鼫ʬ�����ݤ򸫤뤳�ȡ�
d35df41eac69 Initial revision
kono
parents:
diff changeset
365
d35df41eac69 Initial revision
kono
parents:
diff changeset
366 ����
d35df41eac69 Initial revision
kono
parents:
diff changeset
367 a = atoi(s);
d35df41eac69 Initial revision
kono
parents:
diff changeset
368 �ߤ����ʤ��ȤϤǤ��ʤ�...
d35df41eac69 Initial revision
kono
parents:
diff changeset
369
d35df41eac69 Initial revision
kono
parents:
diff changeset
370 ���̤�C������ȸ򤸤�ȴְ㤤�䤹����
d35df41eac69 Initial revision
kono
parents:
diff changeset
371
d35df41eac69 Initial revision
kono
parents:
diff changeset
372 �Ȥ���ȡ�struct ��Ʊ�ͤˡ�
d35df41eac69 Initial revision
kono
parents:
diff changeset
373 protocol
d35df41eac69 Initial revision
kono
parents:
diff changeset
374 code
d35df41eac69 Initial revision
kono
parents:
diff changeset
375 interface
d35df41eac69 Initial revision
kono
parents:
diff changeset
376 state
d35df41eac69 Initial revision
kono
parents:
diff changeset
377 ���Ѱդ���櫓�͡����֤���Τ���?
d35df41eac69 Initial revision
kono
parents:
diff changeset
378
d35df41eac69 Initial revision
kono
parents:
diff changeset
379 �Ȥꤢ������register �Ϥ���function �����gotoʸ��������롣
d35df41eac69 Initial revision
kono
parents:
diff changeset
380
d35df41eac69 Initial revision
kono
parents:
diff changeset
381 code name(register "%ebp" void *arg) {
d35df41eac69 Initial revision
kono
parents:
diff changeset
382 goto name(arg);
d35df41eac69 Initial revision
kono
parents:
diff changeset
383 }
d35df41eac69 Initial revision
kono
parents:
diff changeset
384
d35df41eac69 Initial revision
kono
parents:
diff changeset
385 ���餤����? �ǡ�first argment ��ɬ��register�ˤΤ�褦�ˤ��ʤ���
d35df41eac69 Initial revision
kono
parents:
diff changeset
386 �����ʤ���register storage class ������ơ�
d35df41eac69 Initial revision
kono
parents:
diff changeset
387 register "%ebp" void *arg
d35df41eac69 Initial revision
kono
parents:
diff changeset
388 �Ȥ�����櫓�͡�
d35df41eac69 Initial revision
kono
parents:
diff changeset
389
d35df41eac69 Initial revision
kono
parents:
diff changeset
390 �äƤ��Ȥϡ��ޤ����쥸������������ʤ��Ȥ����ʤ��櫓�͡�
d35df41eac69 Initial revision
kono
parents:
diff changeset
391
d35df41eac69 Initial revision
kono
parents:
diff changeset
392 �ǡ�stack ��Ȥä��黻�ϡ���������Τޤޤˤ���? ����Ǥ�ư���Ϥ���
d35df41eac69 Initial revision
kono
parents:
diff changeset
393 ���������goto�ϻȤ��ʤ�������顢����Ǥ����Ϥ���
d35df41eac69 Initial revision
kono
parents:
diff changeset
394
d35df41eac69 Initial revision
kono
parents:
diff changeset
395 �ǡ����줫�顢������ĥ���Ƥ�����
d35df41eac69 Initial revision
kono
parents:
diff changeset
396
d35df41eac69 Initial revision
kono
parents:
diff changeset
397 interface c {
d35df41eac69 Initial revision
kono
parents:
diff changeset
398 register "%ebp" void *arg;
d35df41eac69 Initial revision
kono
parents:
diff changeset
399 }
d35df41eac69 Initial revision
kono
parents:
diff changeset
400 code name(interface c) {
d35df41eac69 Initial revision
kono
parents:
diff changeset
401 goto name(c.arg); // c. �Ͼ�ά��ǽ
d35df41eac69 Initial revision
kono
parents:
diff changeset
402 }
d35df41eac69 Initial revision
kono
parents:
diff changeset
403
d35df41eac69 Initial revision
kono
parents:
diff changeset
404 �Ȥ��͡�����ˡ�
d35df41eac69 Initial revision
kono
parents:
diff changeset
405
d35df41eac69 Initial revision
kono
parents:
diff changeset
406 protocol name {
d35df41eac69 Initial revision
kono
parents:
diff changeset
407 interface c {
d35df41eac69 Initial revision
kono
parents:
diff changeset
408 register "%ebp" void *arg;
d35df41eac69 Initial revision
kono
parents:
diff changeset
409 }
d35df41eac69 Initial revision
kono
parents:
diff changeset
410 code name(interface c) {
d35df41eac69 Initial revision
kono
parents:
diff changeset
411 goto name(arg);
d35df41eac69 Initial revision
kono
parents:
diff changeset
412 }
d35df41eac69 Initial revision
kono
parents:
diff changeset
413 code name1(interface c) {
d35df41eac69 Initial revision
kono
parents:
diff changeset
414 goto name(arg);
d35df41eac69 Initial revision
kono
parents:
diff changeset
415 }
d35df41eac69 Initial revision
kono
parents:
diff changeset
416 }
d35df41eac69 Initial revision
kono
parents:
diff changeset
417
d35df41eac69 Initial revision
kono
parents:
diff changeset
418 �ʤɤȤ���櫓�����ʤ�ȡ����줬 C �ȶ�¸����櫓�͡�������
d35df41eac69 Initial revision
kono
parents:
diff changeset
419
d35df41eac69 Initial revision
kono
parents:
diff changeset
420 Fri Dec 31 11:44:03 JST 1999
d35df41eac69 Initial revision
kono
parents:
diff changeset
421
d35df41eac69 Initial revision
kono
parents:
diff changeset
422 code �Ǥʤ��ơ��̤�̾���Τۤ����ɤ��ʤ�? segment? action?
d35df41eac69 Initial revision
kono
parents:
diff changeset
423
d35df41eac69 Initial revision
kono
parents:
diff changeset
424 �쥸����̾������Τϡ���äѤꤤ�䡣optional�ˤϵ�����
d35df41eac69 Initial revision
kono
parents:
diff changeset
425
d35df41eac69 Initial revision
kono
parents:
diff changeset
426 interface �Ϲ�¤�ΤΤ褦�ʤ�Τ�����... ��¤�ΤǤ����󤸤�ʤ�?
d35df41eac69 Initial revision
kono
parents:
diff changeset
427 ��¤�Τξ���... malloc ����? ����������malloc ����Ȥ��ơ�
d35df41eac69 Initial revision
kono
parents:
diff changeset
428 ����free �����?
d35df41eac69 Initial revision
kono
parents:
diff changeset
429
d35df41eac69 Initial revision
kono
parents:
diff changeset
430 ��������Ȥ��ˤϡ�����ƤƤ����󤸤�ʤ�? multi-thread �Ǥʤ���Ф͡�
d35df41eac69 Initial revision
kono
parents:
diff changeset
431 multi thread �Ǥϡ����֤ϡ��쥸������ͳ�ޤ��ϡ�thread local �˻���
d35df41eac69 Initial revision
kono
parents:
diff changeset
432 ɬ�פ����롣static �ϡ������� thread local �˻����ʤ��ƤϤʤ�ʤ���
d35df41eac69 Initial revision
kono
parents:
diff changeset
433 ����ѿ��˳�꿶�ä�����ᡣ�Ǥ⡢���ޤϡ�����
d35df41eac69 Initial revision
kono
parents:
diff changeset
434
d35df41eac69 Initial revision
kono
parents:
diff changeset
435 interface �ϡ��Ȥꤢ��������ĤޤǤ����Ϥ��ˤ��褦��
d35df41eac69 Initial revision
kono
parents:
diff changeset
436 self �� arg
d35df41eac69 Initial revision
kono
parents:
diff changeset
437 �Ǥ��͡�
d35df41eac69 Initial revision
kono
parents:
diff changeset
438
d35df41eac69 Initial revision
kono
parents:
diff changeset
439 �⤦������ĥ���䤹������ѥ��餬�����ʤ���
d35df41eac69 Initial revision
kono
parents:
diff changeset
440
d35df41eac69 Initial revision
kono
parents:
diff changeset
441 code name (c,a)
d35df41eac69 Initial revision
kono
parents:
diff changeset
442 struct state *c; struct arg *a;
d35df41eac69 Initial revision
kono
parents:
diff changeset
443 {
d35df41eac69 Initial revision
kono
parents:
diff changeset
444 goto name(arg);
d35df41eac69 Initial revision
kono
parents:
diff changeset
445 }
d35df41eac69 Initial revision
kono
parents:
diff changeset
446
d35df41eac69 Initial revision
kono
parents:
diff changeset
447 local �ѿ���? ���θߴ��������꤫����
d35df41eac69 Initial revision
kono
parents:
diff changeset
448
d35df41eac69 Initial revision
kono
parents:
diff changeset
449 KL/1 ��ռ����ơ�interface �� heap ���֤����Ȥˤ��Ƥ��ɤ���
d35df41eac69 Initial revision
kono
parents:
diff changeset
450 GC �ϸ��������Ƥ����٤�������interface�� machine independent
d35df41eac69 Initial revision
kono
parents:
diff changeset
451 �Ǥ���٤������Ȥ���� use/forget �ߤ�����ΤϤ����������
d35df41eac69 Initial revision
kono
parents:
diff changeset
452 �Ǥ⺣�ΤȤ����Ϲͤ���ɬ�פϤʤ���
d35df41eac69 Initial revision
kono
parents:
diff changeset
453
d35df41eac69 Initial revision
kono
parents:
diff changeset
454 �����ȡ�
d35df41eac69 Initial revision
kono
parents:
diff changeset
455 code name (c,a)
d35df41eac69 Initial revision
kono
parents:
diff changeset
456 struct state *c; struct arg *a;
d35df41eac69 Initial revision
kono
parents:
diff changeset
457 {
d35df41eac69 Initial revision
kono
parents:
diff changeset
458 int i;
d35df41eac69 Initial revision
kono
parents:
diff changeset
459 goto name(arg);
d35df41eac69 Initial revision
kono
parents:
diff changeset
460 }
d35df41eac69 Initial revision
kono
parents:
diff changeset
461 �λ��ΰ���ѿ�i�Ϥɤ������? ����Ū�ˤϥ쥸����������Ƥ�����...
d35df41eac69 Initial revision
kono
parents:
diff changeset
462 ���Ѥ����ʤ�? �󡼡������ʸ�ո����ޤ�����äѤ�heap�˳�����Ƥ��㤦
d35df41eac69 Initial revision
kono
parents:
diff changeset
463 �Τ���ñ�����Ǥ⡢�ɤ���ȴ������ˤϤ���ʤ��ʤ�櫓������...
d35df41eac69 Initial revision
kono
parents:
diff changeset
464
d35df41eac69 Initial revision
kono
parents:
diff changeset
465 �ۤ�餤�������ѿ��ϡ�����call�Ǥ�ɬ��̵���ʤ�Τ����̡�
d35df41eac69 Initial revision
kono
parents:
diff changeset
466
d35df41eac69 Initial revision
kono
parents:
diff changeset
467 �Ȥˤ������쥸�����ѿ���ɬ�פʤ�Ǥ��礦?
d35df41eac69 Initial revision
kono
parents:
diff changeset
468
d35df41eac69 Initial revision
kono
parents:
diff changeset
469 �����顢GC �ȹ�碌�Ƹ�����߷פ��٤�����͡�API ���ꤷ�ơ�
d35df41eac69 Initial revision
kono
parents:
diff changeset
470 �ۤʤ�GC������Ǥ���褦�ˤ��롣
d35df41eac69 Initial revision
kono
parents:
diff changeset
471
d35df41eac69 Initial revision
kono
parents:
diff changeset
472 Sat Jan 1 22:40:22 JST 2000
d35df41eac69 Initial revision
kono
parents:
diff changeset
473
d35df41eac69 Initial revision
kono
parents:
diff changeset
474 �ȡ��ˤ����� storage class regisgter ��������褦��
d35df41eac69 Initial revision
kono
parents:
diff changeset
475
d35df41eac69 Initial revision
kono
parents:
diff changeset
476 stmode=REGISTER
d35df41eac69 Initial revision
kono
parents:
diff changeset
477
d35df41eac69 Initial revision
kono
parents:
diff changeset
478 �ǡ�local storage �Ȥ��ʤ������Ȥ���
d35df41eac69 Initial revision
kono
parents:
diff changeset
479 static register? �ϡ��ʤ���
d35df41eac69 Initial revision
kono
parents:
diff changeset
480
d35df41eac69 Initial revision
kono
parents:
diff changeset
481 symbol table �� storage class �򤿤���? dsp==EXTRN ��Ƚ�ꤷ�Ƥ��뤫�顢
d35df41eac69 Initial revision
kono
parents:
diff changeset
482 local �ѿ���36�ʾ夢��Ȥ��������ʤ뤾?
d35df41eac69 Initial revision
kono
parents:
diff changeset
483
d35df41eac69 Initial revision
kono
parents:
diff changeset
484 sc �� GVAR/LVAR �����ɡ�regsiter �� LVAR ���ü���ۤ����顢
d35df41eac69 Initial revision
kono
parents:
diff changeset
485 sc �������ۤ�����������...
d35df41eac69 Initial revision
kono
parents:
diff changeset
486
d35df41eac69 Initial revision
kono
parents:
diff changeset
487 Sun Jan 2 01:47:17 JST 2000
d35df41eac69 Initial revision
kono
parents:
diff changeset
488
d35df41eac69 Initial revision
kono
parents:
diff changeset
489 register �ѿ��ϤǤ��ޤ��������ɡ�regsiter ����ĻȤ��ȡ�
d35df41eac69 Initial revision
kono
parents:
diff changeset
490 ���դˤʤäƤ��ޤ��Τǡ�REGISTER6 �ǥ���ѥ��뤷�ʤ���
d35df41eac69 Initial revision
kono
parents:
diff changeset
491 �빽�Ҥɤ�������register �ѿ���%esi,%edi �˳�����Ƥ��
d35df41eac69 Initial revision
kono
parents:
diff changeset
492 ��������
d35df41eac69 Initial revision
kono
parents:
diff changeset
493
d35df41eac69 Initial revision
kono
parents:
diff changeset
494 Sun Jan 2 04:43:04 JST 2000
d35df41eac69 Initial revision
kono
parents:
diff changeset
495
d35df41eac69 Initial revision
kono
parents:
diff changeset
496 �ǡ�
d35df41eac69 Initial revision
kono
parents:
diff changeset
497 code name (c,a)
d35df41eac69 Initial revision
kono
parents:
diff changeset
498 struct state *c; struct arg *a;
d35df41eac69 Initial revision
kono
parents:
diff changeset
499 {
d35df41eac69 Initial revision
kono
parents:
diff changeset
500 goto name(c);
d35df41eac69 Initial revision
kono
parents:
diff changeset
501 }
d35df41eac69 Initial revision
kono
parents:
diff changeset
502 �ΰ���ѿ�̵���ϼ����Ǥ��ޤ�����������ĤޤǤ͡�
d35df41eac69 Initial revision
kono
parents:
diff changeset
503
d35df41eac69 Initial revision
kono
parents:
diff changeset
504 .file "tmp.c"
d35df41eac69 Initial revision
kono
parents:
diff changeset
505 .version "01.01"
d35df41eac69 Initial revision
kono
parents:
diff changeset
506 gcc2_compiled.:
d35df41eac69 Initial revision
kono
parents:
diff changeset
507 .text
d35df41eac69 Initial revision
kono
parents:
diff changeset
508 #
d35df41eac69 Initial revision
kono
parents:
diff changeset
509 # code name(c,a)
d35df41eac69 Initial revision
kono
parents:
diff changeset
510 .align 2
d35df41eac69 Initial revision
kono
parents:
diff changeset
511 .globl code
d35df41eac69 Initial revision
kono
parents:
diff changeset
512 code:
d35df41eac69 Initial revision
kono
parents:
diff changeset
513 .type code,@function
d35df41eac69 Initial revision
kono
parents:
diff changeset
514 # struct state *c; struct arg *a;
d35df41eac69 Initial revision
kono
parents:
diff changeset
515 # {
d35df41eac69 Initial revision
kono
parents:
diff changeset
516 # goto name(c);
d35df41eac69 Initial revision
kono
parents:
diff changeset
517 movl %esi,%esi
d35df41eac69 Initial revision
kono
parents:
diff changeset
518 jmp name
d35df41eac69 Initial revision
kono
parents:
diff changeset
519 _5:
d35df41eac69 Initial revision
kono
parents:
diff changeset
520 .size code,_5-code
d35df41eac69 Initial revision
kono
parents:
diff changeset
521 .ident "Micro-C compiled"
d35df41eac69 Initial revision
kono
parents:
diff changeset
522
d35df41eac69 Initial revision
kono
parents:
diff changeset
523 ������������
d35df41eac69 Initial revision
kono
parents:
diff changeset
524
d35df41eac69 Initial revision
kono
parents:
diff changeset
525 goto ʸ�����ɤ�������stack �򤿤���ǡ�jmp �����
d35df41eac69 Initial revision
kono
parents:
diff changeset
526 �褤��������..
d35df41eac69 Initial revision
kono
parents:
diff changeset
527
d35df41eac69 Initial revision
kono
parents:
diff changeset
528 Sun Jan 2 11:17:50 JST 2000
d35df41eac69 Initial revision
kono
parents:
diff changeset
529
d35df41eac69 Initial revision
kono
parents:
diff changeset
530 ���̤�call��continuation base�ˤ��뤳�Ȥ��Ǥ���?
d35df41eac69 Initial revision
kono
parents:
diff changeset
531
d35df41eac69 Initial revision
kono
parents:
diff changeset
532 Sun Jan 2 20:28:45 JST 2000
d35df41eac69 Initial revision
kono
parents:
diff changeset
533
d35df41eac69 Initial revision
kono
parents:
diff changeset
534 goto ʸ�����ɡ���Ϥꡢ���١�expr ���������Ƥ��顢top level
d35df41eac69 Initial revision
kono
parents:
diff changeset
535 �� jump code ���������褦��
d35df41eac69 Initial revision
kono
parents:
diff changeset
536
d35df41eac69 Initial revision
kono
parents:
diff changeset
537 Tue Jan 4 03:32:55 JST 2000
d35df41eac69 Initial revision
kono
parents:
diff changeset
538
d35df41eac69 Initial revision
kono
parents:
diff changeset
539 code ��type�ˤ��ʤ��ȡ�
d35df41eac69 Initial revision
kono
parents:
diff changeset
540 code *p;
d35df41eac69 Initial revision
kono
parents:
diff changeset
541 �Ȥ��񤱤ʤ��͡�
d35df41eac69 Initial revision
kono
parents:
diff changeset
542 int *p();
d35df41eac69 Initial revision
kono
parents:
diff changeset
543 ��Ʊ�������ɤ���
d35df41eac69 Initial revision
kono
parents:
diff changeset
544
d35df41eac69 Initial revision
kono
parents:
diff changeset
545
d35df41eac69 Initial revision
kono
parents:
diff changeset
546 main(ac,av)
d35df41eac69 Initial revision
kono
parents:
diff changeset
547 int ac;
d35df41eac69 Initial revision
kono
parents:
diff changeset
548 char *av[];
d35df41eac69 Initial revision
kono
parents:
diff changeset
549 {
d35df41eac69 Initial revision
kono
parents:
diff changeset
550 goto code1(ac,av);
d35df41eac69 Initial revision
kono
parents:
diff changeset
551 }
d35df41eac69 Initial revision
kono
parents:
diff changeset
552
d35df41eac69 Initial revision
kono
parents:
diff changeset
553 code code1(ac,av)
d35df41eac69 Initial revision
kono
parents:
diff changeset
554 int ac;
d35df41eac69 Initial revision
kono
parents:
diff changeset
555 char *av[];
d35df41eac69 Initial revision
kono
parents:
diff changeset
556 {
d35df41eac69 Initial revision
kono
parents:
diff changeset
557 if (ac)
d35df41eac69 Initial revision
kono
parents:
diff changeset
558 goto code1(ac,av);
d35df41eac69 Initial revision
kono
parents:
diff changeset
559 else
d35df41eac69 Initial revision
kono
parents:
diff changeset
560 goto ac(ac,av);
d35df41eac69 Initial revision
kono
parents:
diff changeset
561 }
d35df41eac69 Initial revision
kono
parents:
diff changeset
562
d35df41eac69 Initial revision
kono
parents:
diff changeset
563 Tue Jan 4 04:56:56 JST 2000
d35df41eac69 Initial revision
kono
parents:
diff changeset
564
d35df41eac69 Initial revision
kono
parents:
diff changeset
565 �����󡢤ʤ󤫥쥸�����ˤĤ������㤦
d35df41eac69 Initial revision
kono
parents:
diff changeset
566 ����ϡ�adecl ��reverse�ˤĤफ�顣
d35df41eac69 Initial revision
kono
parents:
diff changeset
567
d35df41eac69 Initial revision
kono
parents:
diff changeset
568 code ��retrun
d35df41eac69 Initial revision
kono
parents:
diff changeset
569
d35df41eac69 Initial revision
kono
parents:
diff changeset
570 ��Ϥ�code��type�ˤ��ʤ��Ȥ��ᡣ
d35df41eac69 Initial revision
kono
parents:
diff changeset
571
d35df41eac69 Initial revision
kono
parents:
diff changeset
572 main()
d35df41eac69 Initial revision
kono
parents:
diff changeset
573 {
d35df41eac69 Initial revision
kono
parents:
diff changeset
574 goto code1();
d35df41eac69 Initial revision
kono
parents:
diff changeset
575 }
d35df41eac69 Initial revision
kono
parents:
diff changeset
576
d35df41eac69 Initial revision
kono
parents:
diff changeset
577 �Ȥ����ȡ�main ����ä����ʤ����������code1() �ʹߤǡ�
d35df41eac69 Initial revision
kono
parents:
diff changeset
578 return ����櫓�ˤϤ����ʤ���(main �� disp ��code1 ���Τ����ʤ�)
d35df41eac69 Initial revision
kono
parents:
diff changeset
579 goto label ��code1����������?
d35df41eac69 Initial revision
kono
parents:
diff changeset
580
d35df41eac69 Initial revision
kono
parents:
diff changeset
581 main()
d35df41eac69 Initial revision
kono
parents:
diff changeset
582 {
d35df41eac69 Initial revision
kono
parents:
diff changeset
583 goto code1(ret);
d35df41eac69 Initial revision
kono
parents:
diff changeset
584 ret:
d35df41eac69 Initial revision
kono
parents:
diff changeset
585 }
d35df41eac69 Initial revision
kono
parents:
diff changeset
586
d35df41eac69 Initial revision
kono
parents:
diff changeset
587 ������ȡ�ret ��forward label���ɤ���ʬ����ʤ�����?
d35df41eac69 Initial revision
kono
parents:
diff changeset
588
d35df41eac69 Initial revision
kono
parents:
diff changeset
589 code1 ��ǻȤ�����ѿ��� stack ��ˤȤ�Τϰ����ʤ����������������
d35df41eac69 Initial revision
kono
parents:
diff changeset
590 %ebp ��ͳ�ǥ�����������Ȥ������Ȥϡ�main ������ѿ�������Ȥ������ȡ�
d35df41eac69 Initial revision
kono
parents:
diff changeset
591 ������ɤ��ˤϡ�main ���goto code�ǡ�%ebp �������Ƥ����ɤ���
d35df41eac69 Initial revision
kono
parents:
diff changeset
592 (������ä���ʤ��Τ�����ʤ�)
d35df41eac69 Initial revision
kono
parents:
diff changeset
593
d35df41eac69 Initial revision
kono
parents:
diff changeset
594 code1 ��goto �Ǥϡ���ä���ʤ����顢����ɬ�פϤʤ�����������
d35df41eac69 Initial revision
kono
parents:
diff changeset
595 label ��code1 ����Ϥ����ȡ�����äȵ��ޤ�����
d35df41eac69 Initial revision
kono
parents:
diff changeset
596
d35df41eac69 Initial revision
kono
parents:
diff changeset
597 �Ȥ���ȡ�����϶ػߤ��ơ�main() ���stack�򤿤���Ǥ���goto���뤫?
d35df41eac69 Initial revision
kono
parents:
diff changeset
598 ��������ȡ�̵�¸��ष�ơ���ɡ�����ʤ����Ȥˤʤ�... ������
d35df41eac69 Initial revision
kono
parents:
diff changeset
599
d35df41eac69 Initial revision
kono
parents:
diff changeset
600 main() ���local code ������С�����ϲ�褹�뤬..
d35df41eac69 Initial revision
kono
parents:
diff changeset
601
d35df41eac69 Initial revision
kono
parents:
diff changeset
602 main()
d35df41eac69 Initial revision
kono
parents:
diff changeset
603 {
d35df41eac69 Initial revision
kono
parents:
diff changeset
604 goto code1(code2);
d35df41eac69 Initial revision
kono
parents:
diff changeset
605 code code2() {
d35df41eac69 Initial revision
kono
parents:
diff changeset
606 return;
d35df41eac69 Initial revision
kono
parents:
diff changeset
607 }
d35df41eac69 Initial revision
kono
parents:
diff changeset
608 }
d35df41eac69 Initial revision
kono
parents:
diff changeset
609
d35df41eac69 Initial revision
kono
parents:
diff changeset
610 �ߤ����ʴ������Ǥ⡢���������scope rule ���Ѥ���ɬ�פ�����ΤǸ�������
d35df41eac69 Initial revision
kono
parents:
diff changeset
611 �ޡ������Ϥʤ����ɤ͡�
d35df41eac69 Initial revision
kono
parents:
diff changeset
612
d35df41eac69 Initial revision
kono
parents:
diff changeset
613 continuation ������������ˡ�⤢�롣
d35df41eac69 Initial revision
kono
parents:
diff changeset
614
d35df41eac69 Initial revision
kono
parents:
diff changeset
615 main()
d35df41eac69 Initial revision
kono
parents:
diff changeset
616 {
d35df41eac69 Initial revision
kono
parents:
diff changeset
617 goto code1(continuation);
d35df41eac69 Initial revision
kono
parents:
diff changeset
618 }
d35df41eac69 Initial revision
kono
parents:
diff changeset
619 code code1(ret)
d35df41eac69 Initial revision
kono
parents:
diff changeset
620 code (*ret)();
d35df41eac69 Initial revision
kono
parents:
diff changeset
621 {
d35df41eac69 Initial revision
kono
parents:
diff changeset
622 goto *ret;
d35df41eac69 Initial revision
kono
parents:
diff changeset
623 }
d35df41eac69 Initial revision
kono
parents:
diff changeset
624
d35df41eac69 Initial revision
kono
parents:
diff changeset
625 ����? call/cc ?
d35df41eac69 Initial revision
kono
parents:
diff changeset
626
d35df41eac69 Initial revision
kono
parents:
diff changeset
627 label �ؤ�goto������Τ⤤�����ɡ�
d35df41eac69 Initial revision
kono
parents:
diff changeset
628 �Ǥ⡢label ������ȡ�������spagetty�ˤʤ�ʤ�?
d35df41eac69 Initial revision
kono
parents:
diff changeset
629
d35df41eac69 Initial revision
kono
parents:
diff changeset
630
d35df41eac69 Initial revision
kono
parents:
diff changeset
631 Tue Jan 4 11:47:24 JST 2000
d35df41eac69 Initial revision
kono
parents:
diff changeset
632
d35df41eac69 Initial revision
kono
parents:
diff changeset
633 contiunation ����ʤ��ơ�return keyword ��Ȥ�����
d35df41eac69 Initial revision
kono
parents:
diff changeset
634 (�ºݡ�continuation �Ⱦ����㤦��)
d35df41eac69 Initial revision
kono
parents:
diff changeset
635 type �������Ѥˤʤ뤱�ɡ��ޤ��ɤ���
d35df41eac69 Initial revision
kono
parents:
diff changeset
636
d35df41eac69 Initial revision
kono
parents:
diff changeset
637 int
d35df41eac69 Initial revision
kono
parents:
diff changeset
638 main()
d35df41eac69 Initial revision
kono
parents:
diff changeset
639 {
d35df41eac69 Initial revision
kono
parents:
diff changeset
640 goto code1(return);
d35df41eac69 Initial revision
kono
parents:
diff changeset
641 }
d35df41eac69 Initial revision
kono
parents:
diff changeset
642 code code1(ret)
d35df41eac69 Initial revision
kono
parents:
diff changeset
643 code (*ret)(int);
d35df41eac69 Initial revision
kono
parents:
diff changeset
644 {
d35df41eac69 Initial revision
kono
parents:
diff changeset
645 goto *ret(3);
d35df41eac69 Initial revision
kono
parents:
diff changeset
646 }
d35df41eac69 Initial revision
kono
parents:
diff changeset
647
d35df41eac69 Initial revision
kono
parents:
diff changeset
648 ���ʡ�prototype ���դ��ʤ��Ȥ����ʤ�����
d35df41eac69 Initial revision
kono
parents:
diff changeset
649
d35df41eac69 Initial revision
kono
parents:
diff changeset
650 Tue Jan 4 12:21:44 JST 2000
d35df41eac69 Initial revision
kono
parents:
diff changeset
651
d35df41eac69 Initial revision
kono
parents:
diff changeset
652 �������method�����٤�static �ˤʤäƤ��ޤ���dynamic ��method
d35df41eac69 Initial revision
kono
parents:
diff changeset
653 �ƤӽФ��ˤ���ˤ�? dipatcher ��ʬ�Ǻ�뤳�Ȥˤʤ롣���ʤ�
d35df41eac69 Initial revision
kono
parents:
diff changeset
654 ���ɤ�������...
d35df41eac69 Initial revision
kono
parents:
diff changeset
655
d35df41eac69 Initial revision
kono
parents:
diff changeset
656 code method(obj,arg)
d35df41eac69 Initial revision
kono
parents:
diff changeset
657 {
d35df41eac69 Initial revision
kono
parents:
diff changeset
658 }
d35df41eac69 Initial revision
kono
parents:
diff changeset
659
d35df41eac69 Initial revision
kono
parents:
diff changeset
660 �������뤤�ϡ�inline �ˤ��뤫... #define �Τ����� inline �ͤ���
d35df41eac69 Initial revision
kono
parents:
diff changeset
661 ����Ϥ��Ȥǹͤ����ɤ���
d35df41eac69 Initial revision
kono
parents:
diff changeset
662
d35df41eac69 Initial revision
kono
parents:
diff changeset
663 Tue Jan 4 14:22:19 JST 2000
d35df41eac69 Initial revision
kono
parents:
diff changeset
664
d35df41eac69 Initial revision
kono
parents:
diff changeset
665 main ���ѿ�����٤��Τȡ�gotgo (*reg)(123) �Ǥ��ͤϡ�
d35df41eac69 Initial revision
kono
parents:
diff changeset
666 register �Ϥ��ǡ�current register �ˤΤ�ʤ��Τǡ�
d35df41eac69 Initial revision
kono
parents:
diff changeset
667 ��ɡ�return label �����Ѥ˺��ɬ�פ����롣
d35df41eac69 Initial revision
kono
parents:
diff changeset
668
d35df41eac69 Initial revision
kono
parents:
diff changeset
669 Tue Jan 4 18:14:07 JST 2000
d35df41eac69 Initial revision
kono
parents:
diff changeset
670
d35df41eac69 Initial revision
kono
parents:
diff changeset
671 stack ��Ѥ�­���ơ��ƤӽФ���������С�call by value
d35df41eac69 Initial revision
kono
parents:
diff changeset
672 ��register �Ϥ������¤���ɬ�פ�̵���ʤ롣
d35df41eac69 Initial revision
kono
parents:
diff changeset
673
d35df41eac69 Initial revision
kono
parents:
diff changeset
674 ʣ�����ͤ��֤����Ȥ��ưפ���
d35df41eac69 Initial revision
kono
parents:
diff changeset
675
d35df41eac69 Initial revision
kono
parents:
diff changeset
676 .file "tmp.c"
d35df41eac69 Initial revision
kono
parents:
diff changeset
677 .version "01.01"
d35df41eac69 Initial revision
kono
parents:
diff changeset
678 gcc2_compiled.:
d35df41eac69 Initial revision
kono
parents:
diff changeset
679 .text
d35df41eac69 Initial revision
kono
parents:
diff changeset
680 #
d35df41eac69 Initial revision
kono
parents:
diff changeset
681 # code name(a,b,c,d,e,f)
d35df41eac69 Initial revision
kono
parents:
diff changeset
682 .align 2
d35df41eac69 Initial revision
kono
parents:
diff changeset
683 .globl code
d35df41eac69 Initial revision
kono
parents:
diff changeset
684 code:
d35df41eac69 Initial revision
kono
parents:
diff changeset
685 .type code,@function
d35df41eac69 Initial revision
kono
parents:
diff changeset
686 # struct arg *a,*b,*c,*d,*e,*f;
d35df41eac69 Initial revision
kono
parents:
diff changeset
687 # {
d35df41eac69 Initial revision
kono
parents:
diff changeset
688 # int g;
d35df41eac69 Initial revision
kono
parents:
diff changeset
689 # goto name(a,b,d,e,f);
d35df41eac69 Initial revision
kono
parents:
diff changeset
690 jmp name
d35df41eac69 Initial revision
kono
parents:
diff changeset
691 _5:
d35df41eac69 Initial revision
kono
parents:
diff changeset
692 .size code,_5-code
d35df41eac69 Initial revision
kono
parents:
diff changeset
693 .ident "Micro-C compiled"
d35df41eac69 Initial revision
kono
parents:
diff changeset
694
d35df41eac69 Initial revision
kono
parents:
diff changeset
695 ����?!
d35df41eac69 Initial revision
kono
parents:
diff changeset
696 %esp new %esp = old %esp - 12 -4
d35df41eac69 Initial revision
kono
parents:
diff changeset
697 %ebp-4 = g
d35df41eac69 Initial revision
kono
parents:
diff changeset
698 %esi = a
d35df41eac69 Initial revision
kono
parents:
diff changeset
699 %edi = b
d35df41eac69 Initial revision
kono
parents:
diff changeset
700 %ebp = old %esp 0
d35df41eac69 Initial revision
kono
parents:
diff changeset
701 %ebp+4 = c code_arg_offset=0
d35df41eac69 Initial revision
kono
parents:
diff changeset
702 %ebp+8 = d
d35df41eac69 Initial revision
kono
parents:
diff changeset
703 %ebp+12 = e
d35df41eac69 Initial revision
kono
parents:
diff changeset
704 %ebp+16 = f
d35df41eac69 Initial revision
kono
parents:
diff changeset
705
d35df41eac69 Initial revision
kono
parents:
diff changeset
706 interface ���դ��褦! �Ȥ�������
d35df41eac69 Initial revision
kono
parents:
diff changeset
707 goto name(struct {xxxx})
d35df41eac69 Initial revision
kono
parents:
diff changeset
708 �ߤ����ʴ������ɤ��櫓�͡��ɤ��register�ˤ���뤫�ȸ�������Ϥ��뤬��
d35df41eac69 Initial revision
kono
parents:
diff changeset
709
d35df41eac69 Initial revision
kono
parents:
diff changeset
710 �ǡ��ɤ���ä�call����Ф����櫓? emit_push���뤫����push
d35df41eac69 Initial revision
kono
parents:
diff changeset
711 ����?
d35df41eac69 Initial revision
kono
parents:
diff changeset
712
d35df41eac69 Initial revision
kono
parents:
diff changeset
713 ����������Ǥϡ����ᤫ��code argument �ο����Ѥ��ȡ�
d35df41eac69 Initial revision
kono
parents:
diff changeset
714 ebp �򤤤�����ư�������Ȥˤʤ롣�����ˤ�old sp �����뤫��
d35df41eac69 Initial revision
kono
parents:
diff changeset
715 �����Ĥ⥳�ԡ�����ɬ�פ����롣
d35df41eac69 Initial revision
kono
parents:
diff changeset
716
d35df41eac69 Initial revision
kono
parents:
diff changeset
717 %esp new %esp = old %esp - 20
d35df41eac69 Initial revision
kono
parents:
diff changeset
718 %ebp-20 = g
d35df41eac69 Initial revision
kono
parents:
diff changeset
719 %esi = a
d35df41eac69 Initial revision
kono
parents:
diff changeset
720 %edi = b
d35df41eac69 Initial revision
kono
parents:
diff changeset
721 %ebp-16 = c code_arg_offset= -16 ((nargs-max_reg)*int_size)
d35df41eac69 Initial revision
kono
parents:
diff changeset
722 %ebp-12 = d
d35df41eac69 Initial revision
kono
parents:
diff changeset
723 %ebp-8 = e
d35df41eac69 Initial revision
kono
parents:
diff changeset
724 %ebp-4 = f
d35df41eac69 Initial revision
kono
parents:
diff changeset
725 %ebp = old %esp 0
d35df41eac69 Initial revision
kono
parents:
diff changeset
726
d35df41eac69 Initial revision
kono
parents:
diff changeset
727 ��������function ����call������ˤϡ�local �ѿ�����٤����ɤ���
d35df41eac69 Initial revision
kono
parents:
diff changeset
728
d35df41eac69 Initial revision
kono
parents:
diff changeset
729 # goto name(a,b,d,e,f);
d35df41eac69 Initial revision
kono
parents:
diff changeset
730
d35df41eac69 Initial revision
kono
parents:
diff changeset
731 %esp new %esp = old %esp - 20
d35df41eac69 Initial revision
kono
parents:
diff changeset
732 %ebp-20 = g
d35df41eac69 Initial revision
kono
parents:
diff changeset
733 %esi = a
d35df41eac69 Initial revision
kono
parents:
diff changeset
734 %edi = b
d35df41eac69 Initial revision
kono
parents:
diff changeset
735 %ebp-16 = c code_arg_offset= -16 ((nargs-max_reg)*int_size)
d35df41eac69 Initial revision
kono
parents:
diff changeset
736 %ebp-12 = d
d35df41eac69 Initial revision
kono
parents:
diff changeset
737 %ebp-8 = e
d35df41eac69 Initial revision
kono
parents:
diff changeset
738 %ebp-4 = f
d35df41eac69 Initial revision
kono
parents:
diff changeset
739 %ebp = old %esp 0 disp=0 (*)
d35df41eac69 Initial revision
kono
parents:
diff changeset
740 local1 <----16 local variable
d35df41eac69 Initial revision
kono
parents:
diff changeset
741 %edx -12 <- disp_offset
d35df41eac69 Initial revision
kono
parents:
diff changeset
742 %ecx -8
d35df41eac69 Initial revision
kono
parents:
diff changeset
743 %ebx -4
d35df41eac69 Initial revision
kono
parents:
diff changeset
744 %ebp = %esp 0
d35df41eac69 Initial revision
kono
parents:
diff changeset
745 %eip 4 <- arg_offset
d35df41eac69 Initial revision
kono
parents:
diff changeset
746
d35df41eac69 Initial revision
kono
parents:
diff changeset
747 �Ȥʤ롣�Ȥ������Ȥϡ�pushl %ebp �ϡ��ְ㤤��
d35df41eac69 Initial revision
kono
parents:
diff changeset
748
d35df41eac69 Initial revision
kono
parents:
diff changeset
749 �����ɡ�%ebp �򤽤Τޤ޻Ȥ��Τ��ɤ��ʤ���disp_offset �������äƤ��뤫�顣
d35df41eac69 Initial revision
kono
parents:
diff changeset
750 �����顢�⤦���� pushl %ebp �����ۤ����褤����������push ������ϡ�
d35df41eac69 Initial revision
kono
parents:
diff changeset
751 ���(*)��
d35df41eac69 Initial revision
kono
parents:
diff changeset
752 leave movl %ebp,%esp
d35df41eac69 Initial revision
kono
parents:
diff changeset
753 popl %ebp
d35df41eac69 Initial revision
kono
parents:
diff changeset
754 ����ʤ��ä���?
d35df41eac69 Initial revision
kono
parents:
diff changeset
755
d35df41eac69 Initial revision
kono
parents:
diff changeset
756 Thu Jan 6 13:00:33 JST 2000
d35df41eac69 Initial revision
kono
parents:
diff changeset
757
d35df41eac69 Initial revision
kono
parents:
diff changeset
758 �Ǥ����͡�����ǤȤꤢ����ư���Ϥ���®�٤��������...
d35df41eac69 Initial revision
kono
parents:
diff changeset
759 ���Ȥϡ�
d35df41eac69 Initial revision
kono
parents:
diff changeset
760 ANSI-C prototype
d35df41eac69 Initial revision
kono
parents:
diff changeset
761 ANSI-C prototype check
d35df41eac69 Initial revision
kono
parents:
diff changeset
762 Interface Definietion
d35df41eac69 Initial revision
kono
parents:
diff changeset
763 GC support
d35df41eac69 Initial revision
kono
parents:
diff changeset
764 Direct handling of Frame
d35df41eac69 Initial revision
kono
parents:
diff changeset
765 ���͡���ñ�˽��褽��? ���֤�...
d35df41eac69 Initial revision
kono
parents:
diff changeset
766
d35df41eac69 Initial revision
kono
parents:
diff changeset
767 Fri Jan 7 09:42:53 JST 2000
d35df41eac69 Initial revision
kono
parents:
diff changeset
768
d35df41eac69 Initial revision
kono
parents:
diff changeset
769 goto ʸ��ư���Ƥʤ��ä������� peep hole optimization version ��
d35df41eac69 Initial revision
kono
parents:
diff changeset
770 ��뤫?
d35df41eac69 Initial revision
kono
parents:
diff changeset
771
d35df41eac69 Initial revision
kono
parents:
diff changeset
772 continuation �Ȥ��� label �������褦�ˤ���٤���?
d35df41eac69 Initial revision
kono
parents:
diff changeset
773 ��������������ʤ�����ɡ�����äȡ������ץ�����ब
d35df41eac69 Initial revision
kono
parents:
diff changeset
774 �����褦�ˤʤ롣���ȡ�����¦�δĶ�(frame)��ݻ�����
d35df41eac69 Initial revision
kono
parents:
diff changeset
775 ɬ�פ����롣�ޡ��Ǥ��ʤ��Ϥʤ���...
d35df41eac69 Initial revision
kono
parents:
diff changeset
776
d35df41eac69 Initial revision
kono
parents:
diff changeset
777 ��������ȡ�label ���ͤ���Ĥ褦�ˤʤ롣
d35df41eac69 Initial revision
kono
parents:
diff changeset
778 a = label:;
d35df41eac69 Initial revision
kono
parents:
diff changeset
779 �Ȥ���������label:(a,b,c) {}; �ߤ����ʷ��ǡ�parallel ����������ȸ���
d35df41eac69 Initial revision
kono
parents:
diff changeset
780 ��⤢��͡�
d35df41eac69 Initial revision
kono
parents:
diff changeset
781
d35df41eac69 Initial revision
kono
parents:
diff changeset
782 �����������C�Ȥ��������ɤ���... main() { label:(){ ... } }
d35df41eac69 Initial revision
kono
parents:
diff changeset
783 �ߤ�����nest��������ɤ����ȸ������꤬���롣
d35df41eac69 Initial revision
kono
parents:
diff changeset
784 �ѿ��λ��Ȥ�����ʤ���С��ä�����Ϥʤ���
d35df41eac69 Initial revision
kono
parents:
diff changeset
785
d35df41eac69 Initial revision
kono
parents:
diff changeset
786 a = label: �ϡ���Ťΰ�̣������ʤ���
d35df41eac69 Initial revision
kono
parents:
diff changeset
787
d35df41eac69 Initial revision
kono
parents:
diff changeset
788 �����̾����DinnerBell II �Ȥ�? join �������?
d35df41eac69 Initial revision
kono
parents:
diff changeset
789 code entry_a().entry_b() {}
d35df41eac69 Initial revision
kono
parents:
diff changeset
790 �Ǥ���? parallel call ��?
d35df41eac69 Initial revision
kono
parents:
diff changeset
791
d35df41eac69 Initial revision
kono
parents:
diff changeset
792 Fri Jan 7 19:53:53 JST 2000
d35df41eac69 Initial revision
kono
parents:
diff changeset
793
d35df41eac69 Initial revision
kono
parents:
diff changeset
794 ���ޤΤޤޤ��� return ���Ķ�����äƤʤ����顢���æ�ФǤ��ʤ���
d35df41eac69 Initial revision
kono
parents:
diff changeset
795 �ޤ����Ķ�������Ƥ⤤��������ɡ��ɤ����֤����ȸ������꤬
d35df41eac69 Initial revision
kono
parents:
diff changeset
796 ����͡�
d35df41eac69 Initial revision
kono
parents:
diff changeset
797
d35df41eac69 Initial revision
kono
parents:
diff changeset
798 ��������ʤ��ơ�return ¦��Ƚ�Ǥ��뤫?
d35df41eac69 Initial revision
kono
parents:
diff changeset
799 retrun(ID)
d35df41eac69 Initial revision
kono
parents:
diff changeset
800 �ߤ����ʷ���ID��Ƚ�Ǥ��롣��������С�return ¦��ID
d35df41eac69 Initial revision
kono
parents:
diff changeset
801 �򸫤�Ƚ�ǤǤ��롣����...
d35df41eac69 Initial revision
kono
parents:
diff changeset
802
d35df41eac69 Initial revision
kono
parents:
diff changeset
803 �ޤ����Ϥ�ꡢ�Ķ�����ä��⤯�����������ʤ����Ǥ⡢
d35df41eac69 Initial revision
kono
parents:
diff changeset
804 �����Ϥ��Ƥ��뤫�顢��İ����Ϥ��ơ�������Ȥ�줿�Ȥ��ˡ�
d35df41eac69 Initial revision
kono
parents:
diff changeset
805 ȿ��¦���ä��Ƥ��ޤ��ΤϤ�������͡����Τޤޤʤ�С�
d35df41eac69 Initial revision
kono
parents:
diff changeset
806 �����������Ȥϵ�����ʤ���
d35df41eac69 Initial revision
kono
parents:
diff changeset
807
d35df41eac69 Initial revision
kono
parents:
diff changeset
808 continuation ��ͭ��������򤱤�ʤ顢���ΤޤޤǤ⤤�������...
d35df41eac69 Initial revision
kono
parents:
diff changeset
809 contrinuation ��Ķ��ϡ����Υ����ƥ�Ǥϼ�ʬ�Ǻ�뤳�Ȥ�
d35df41eac69 Initial revision
kono
parents:
diff changeset
810 �Ǥ��뤫��͡�
d35df41eac69 Initial revision
kono
parents:
diff changeset
811
d35df41eac69 Initial revision
kono
parents:
diff changeset
812 �����ʤ������.... retlabel �� retcont �ϼ¤ϥ��֥�������
d35df41eac69 Initial revision
kono
parents:
diff changeset
813 ���Τ˰�Ĥ�����ɤ���
d35df41eac69 Initial revision
kono
parents:
diff changeset
814
d35df41eac69 Initial revision
kono
parents:
diff changeset
815 �������Ϥ��Ȥ��ˡ������˴Ķ��ؤΥݥ��󥿤򤤤�Ƥ����ɤ��Τǡ�
d35df41eac69 Initial revision
kono
parents:
diff changeset
816 ���ϳ�ȴ�ñ��������������ȡ���ι�¤�Τ�������Ϥ��ȸ���
d35df41eac69 Initial revision
kono
parents:
diff changeset
817 ������褹��ɬ�פ����롣
d35df41eac69 Initial revision
kono
parents:
diff changeset
818
d35df41eac69 Initial revision
kono
parents:
diff changeset
819 �Ǥ⡢���μ����ʤ�С��ޤä���Ʊ���ѿ��ι����ʤ�Х��ԡ���
d35df41eac69 Initial revision
kono
parents:
diff changeset
820 �ºݤˤϵ�����ʤ��櫓����������ʤ��Ϥ����äˡ�������ݾڤ��뤿��ˡ�
d35df41eac69 Initial revision
kono
parents:
diff changeset
821 interface ���������ɬ�פ����롣
d35df41eac69 Initial revision
kono
parents:
diff changeset
822
d35df41eac69 Initial revision
kono
parents:
diff changeset
823 return ->
d35df41eac69 Initial revision
kono
parents:
diff changeset
824 (void *)old bp
d35df41eac69 Initial revision
kono
parents:
diff changeset
825 return address
d35df41eac69 Initial revision
kono
parents:
diff changeset
826
d35df41eac69 Initial revision
kono
parents:
diff changeset
827 bp ��ľ�����Ǥ���褦�ˤ���Ȥ����������....
d35df41eac69 Initial revision
kono
parents:
diff changeset
828
d35df41eac69 Initial revision
kono
parents:
diff changeset
829 Sat Jan 8 08:49:59 JST 2000
d35df41eac69 Initial revision
kono
parents:
diff changeset
830
d35df41eac69 Initial revision
kono
parents:
diff changeset
831 ���ϡ�code ��Ǥ�return�Ǥ��ʤ��櫓�����ɡ��¤ϡ�return �äơ�
d35df41eac69 Initial revision
kono
parents:
diff changeset
832 code return0(i) int i; { return(i); }
d35df41eac69 Initial revision
kono
parents:
diff changeset
833 ��? ���϶ػߤ��Ƥʤ�����񤱤��㤦��͡��ɤ�����code���Ф�������?
d35df41eac69 Initial revision
kono
parents:
diff changeset
834
d35df41eac69 Initial revision
kono
parents:
diff changeset
835 doreturn() �Ǥ� retpending �򥻥åȤ��Ƥ�����������顢control=1
d35df41eac69 Initial revision
kono
parents:
diff changeset
836 �Τޤޡ��ǡ�code �ν���ˤ���Τǥ��顼�ˤʤ롣checkret �ϡ�
d35df41eac69 Initial revision
kono
parents:
diff changeset
837 statement �ΰ�����Ƚ�Ǥ���褦�ˤ����ۤ�������Ū��������
d35df41eac69 Initial revision
kono
parents:
diff changeset
838
d35df41eac69 Initial revision
kono
parents:
diff changeset
839 ���æ�ФϷ빽����������͡�����򥹥��åפ���Ƥ��줷����?
d35df41eac69 Initial revision
kono
parents:
diff changeset
840 destructor ��Ʊ���ǡ������code�������ƤӤ����Τ����̤�������
d35df41eac69 Initial revision
kono
parents:
diff changeset
841
d35df41eac69 Initial revision
kono
parents:
diff changeset
842 bp ��Ʊ���ˤʤ�ޤ� return ������ɤ��櫓����͡�
d35df41eac69 Initial revision
kono
parents:
diff changeset
843 return ��Ʊ���ǡ�����Ū�˴Ķ�������Ϥ��褦�ˤ��뤫��
d35df41eac69 Initial revision
kono
parents:
diff changeset
844 type �� void * ���ɤ�?
d35df41eac69 Initial revision
kono
parents:
diff changeset
845
d35df41eac69 Initial revision
kono
parents:
diff changeset
846 return �������stack�ξ�¤�ۤ��Ƥ��뤫�ɤ�����ʬ�ǥ����å�����
d35df41eac69 Initial revision
kono
parents:
diff changeset
847 ɬ�פ�����͡�ï��return���뤫��code������������ɤ��櫓�����ɡ�
d35df41eac69 Initial revision
kono
parents:
diff changeset
848
d35df41eac69 Initial revision
kono
parents:
diff changeset
849 code return0(i) int i; { return(i); }
d35df41eac69 Initial revision
kono
parents:
diff changeset
850
d35df41eac69 Initial revision
kono
parents:
diff changeset
851 ������ơ������ǡ�frame pointer ����褢�뤤���Ϥ���������
d35df41eac69 Initial revision
kono
parents:
diff changeset
852 ��Ӥ��ƽ�������?
d35df41eac69 Initial revision
kono
parents:
diff changeset
853 code return0(i,env) int i; env *env; {
d35df41eac69 Initial revision
kono
parents:
diff changeset
854 if (env==self) return(i);
d35df41eac69 Initial revision
kono
parents:
diff changeset
855 }
d35df41eac69 Initial revision
kono
parents:
diff changeset
856 ����? ����Ϥ���������͡�
d35df41eac69 Initial revision
kono
parents:
diff changeset
857 code return0(i,env) int i; env *env; {
d35df41eac69 Initial revision
kono
parents:
diff changeset
858 if (env!=self) {
d35df41eac69 Initial revision
kono
parents:
diff changeset
859 env->return();
d35df41eac69 Initial revision
kono
parents:
diff changeset
860 return(i);
d35df41eac69 Initial revision
kono
parents:
diff changeset
861 }
d35df41eac69 Initial revision
kono
parents:
diff changeset
862 }
d35df41eac69 Initial revision
kono
parents:
diff changeset
863 �⡢�ʤ��Ѥ���ʤ����ƤӽФ��ȵս�˵��ꤿ���櫓����...
d35df41eac69 Initial revision
kono
parents:
diff changeset
864 �ºݡ��ս�ˤϵ��äƤ���櫓����͡�
d35df41eac69 Initial revision
kono
parents:
diff changeset
865
d35df41eac69 Initial revision
kono
parents:
diff changeset
866 return ����Ǥ���������Ӥ���Ȥ������⤢�뤱�ɡ�
d35df41eac69 Initial revision
kono
parents:
diff changeset
867
d35df41eac69 Initial revision
kono
parents:
diff changeset
868 ����ϡ�destructor ���Ϥ��������͡��������self ���ɤ��櫓������
d35df41eac69 Initial revision
kono
parents:
diff changeset
869 ���Τ�����ϡ����쳰������ǡ����������Ū�ˤ��������顢���θ����
d35df41eac69 Initial revision
kono
parents:
diff changeset
870 ��äƤ���櫓�ʤΤ����顢����������ǽ�������ΤϤ���������
d35df41eac69 Initial revision
kono
parents:
diff changeset
871
d35df41eac69 Initial revision
kono
parents:
diff changeset
872 code return0(i) int i; { return(i); }
d35df41eac69 Initial revision
kono
parents:
diff changeset
873
d35df41eac69 Initial revision
kono
parents:
diff changeset
874 ������ȡ�return �η������ʤ��ȸ������꤬������ʡ���ñ�ˤ�
d35df41eac69 Initial revision
kono
parents:
diff changeset
875 �����å��Ǥ��ʤ���
d35df41eac69 Initial revision
kono
parents:
diff changeset
876 int
d35df41eac69 Initial revision
kono
parents:
diff changeset
877 main() {
d35df41eac69 Initial revision
kono
parents:
diff changeset
878 code a() {
d35df41eac69 Initial revision
kono
parents:
diff changeset
879 }
d35df41eac69 Initial revision
kono
parents:
diff changeset
880 code b() {
d35df41eac69 Initial revision
kono
parents:
diff changeset
881 return(i);
d35df41eac69 Initial revision
kono
parents:
diff changeset
882 }
d35df41eac69 Initial revision
kono
parents:
diff changeset
883 }
d35df41eac69 Initial revision
kono
parents:
diff changeset
884 �ˤ���С�check �ϤǤ���褦�ˤʤ롣�Ǥ⡢������ȡ�
d35df41eac69 Initial revision
kono
parents:
diff changeset
885 int
d35df41eac69 Initial revision
kono
parents:
diff changeset
886 main() {
d35df41eac69 Initial revision
kono
parents:
diff changeset
887 a: {
d35df41eac69 Initial revision
kono
parents:
diff changeset
888 }
d35df41eac69 Initial revision
kono
parents:
diff changeset
889 b: {
d35df41eac69 Initial revision
kono
parents:
diff changeset
890 return(i);
d35df41eac69 Initial revision
kono
parents:
diff changeset
891 }
d35df41eac69 Initial revision
kono
parents:
diff changeset
892 }
d35df41eac69 Initial revision
kono
parents:
diff changeset
893 �Ⱥ����ʤ���module ������쳰�Ǥ��Ȥ����Τ���ݤʤΤ����顢����Ǥ�
d35df41eac69 Initial revision
kono
parents:
diff changeset
894 �ޤ���������Ϲ�饢����֥�ʤΤ����顣
d35df41eac69 Initial revision
kono
parents:
diff changeset
895
d35df41eac69 Initial revision
kono
parents:
diff changeset
896 ����������return �ȡ����æ�л���abort�Ȥϡ��������㤦�������顢
d35df41eac69 Initial revision
kono
parents:
diff changeset
897 �̤�code ��ƤӽФ��ʤ��Ȥ��ᡣ���뤤�ϡ��ͤǶ��̤��뤫������ϡ�
d35df41eac69 Initial revision
kono
parents:
diff changeset
898 logic programming ��fail/success �Ȼ��Ƥ��롣
d35df41eac69 Initial revision
kono
parents:
diff changeset
899 main() { } abort { ... }
d35df41eac69 Initial revision
kono
parents:
diff changeset
900 �Ǥ⤤������?
d35df41eac69 Initial revision
kono
parents:
diff changeset
901 main() { code abort { ... }; code return { ... }}
d35df41eac69 Initial revision
kono
parents:
diff changeset
902 ����?
d35df41eac69 Initial revision
kono
parents:
diff changeset
903
d35df41eac69 Initial revision
kono
parents:
diff changeset
904 ���衢subroutine call���Τ������ʤ�ξ�ά���ʤ櫓�����顢�����
d35df41eac69 Initial revision
kono
parents:
diff changeset
905 �������ʤ������Τޤޤ��̾��subroutine call�򥷥ߥ�졼�ȤǤ���Τ�?
d35df41eac69 Initial revision
kono
parents:
diff changeset
906 code (struct arg {...},void *sp) {
d35df41eac69 Initial revision
kono
parents:
diff changeset
907 struct env;
d35df41eac69 Initial revision
kono
parents:
diff changeset
908 push(sp,arg);
d35df41eac69 Initial revision
kono
parents:
diff changeset
909 push(env,arg);
d35df41eac69 Initial revision
kono
parents:
diff changeset
910 }
d35df41eac69 Initial revision
kono
parents:
diff changeset
911 �Ǥ��뤱�ɡ�����äȽŤ�����Ϥꡢframe pointer ��ľ�����ʤ���
d35df41eac69 Initial revision
kono
parents:
diff changeset
912 ���ᡣ
d35df41eac69 Initial revision
kono
parents:
diff changeset
913
d35df41eac69 Initial revision
kono
parents:
diff changeset
914 goto ʸ�Τۤ��ˡ�env ����������Τ��ä��ۤ��������Τ��⡣
d35df41eac69 Initial revision
kono
parents:
diff changeset
915 goto (*ret)(),environment;
d35df41eac69 Initial revision
kono
parents:
diff changeset
916 ���ʡ�type ��? (void *)?
d35df41eac69 Initial revision
kono
parents:
diff changeset
917 goto ret(),environment;
d35df41eac69 Initial revision
kono
parents:
diff changeset
918 �ˤϤʤ�ʤ���? ��������С���ʬ��thread������Ǥ��롣environment
d35df41eac69 Initial revision
kono
parents:
diff changeset
919 ����������ɾ�����ʤ����ɤ���? �ޤ����ͤ���
d35df41eac69 Initial revision
kono
parents:
diff changeset
920
d35df41eac69 Initial revision
kono
parents:
diff changeset
921 ����ϼ������ưפ���... goto �Ȥ��������񤯤Τ������ˤ����Τ�?
d35df41eac69 Initial revision
kono
parents:
diff changeset
922 env ���Ф���operation�����ä����������ʤ���push �Ȥ�?
d35df41eac69 Initial revision
kono
parents:
diff changeset
923
d35df41eac69 Initial revision
kono
parents:
diff changeset
924 code return0(i) int i; { return(i); }
d35df41eac69 Initial revision
kono
parents:
diff changeset
925
d35df41eac69 Initial revision
kono
parents:
diff changeset
926 ��ǧ���С�return ���ѿ��Ϥ���ʤ��ʤ롣
d35df41eac69 Initial revision
kono
parents:
diff changeset
927
d35df41eac69 Initial revision
kono
parents:
diff changeset
928 �Ǥ⡢�¤ϡ�return �ϡ�caller �ΰ����ο��Ȱ��פ��Ƥʤ��Ȥ����ʤ�
d35df41eac69 Initial revision
kono
parents:
diff changeset
929 �櫓�����顢 code return0(i) int i; { return(i); } �Ϥ��ᡣenv
d35df41eac69 Initial revision
kono
parents:
diff changeset
930 �Ȱ��פ��Ƥʤ��Ȥ����ʤ����Ȥ������Ȥ�ʬΥ����Ȥޤ����󤸤�ʤ�?
d35df41eac69 Initial revision
kono
parents:
diff changeset
931 ����? ����ʤϤ��ʤ��ʡ�
d35df41eac69 Initial revision
kono
parents:
diff changeset
932
d35df41eac69 Initial revision
kono
parents:
diff changeset
933 Sun Jan 9 01:15:56 JST 2000
d35df41eac69 Initial revision
kono
parents:
diff changeset
934
d35df41eac69 Initial revision
kono
parents:
diff changeset
935 ��ϤꡢʬΥ���ƤϤޤ�������Ȥ�ȡ�
d35df41eac69 Initial revision
kono
parents:
diff changeset
936 goto func(arg);
d35df41eac69 Initial revision
kono
parents:
diff changeset
937 ������
d35df41eac69 Initial revision
kono
parents:
diff changeset
938 goto func(arg) with current.env
d35df41eac69 Initial revision
kono
parents:
diff changeset
939 �ߤ����ʤ�Τ����Ĥޤꡢ����ϡ�DinnerBell �Ρ�
d35df41eac69 Initial revision
kono
parents:
diff changeset
940 self message: arg
d35df41eac69 Initial revision
kono
parents:
diff changeset
941 ��Ʊ����self->func(arg); �Ǥ��ɤ�������function call�ȶ��̤��դ��ʤ��Τ�
d35df41eac69 Initial revision
kono
parents:
diff changeset
942 �ɤ��ʤ���
d35df41eac69 Initial revision
kono
parents:
diff changeset
943
d35df41eac69 Initial revision
kono
parents:
diff changeset
944 ��������ȡ�type code ��size int �Ǥʤ��ʤ롣
d35df41eac69 Initial revision
kono
parents:
diff changeset
945 code *p = func;
d35df41eac69 Initial revision
kono
parents:
diff changeset
946 �ǤϤ����ʤ��ơ�
d35df41eac69 Initial revision
kono
parents:
diff changeset
947 code p = {func,env};
d35df41eac69 Initial revision
kono
parents:
diff changeset
948 �Ǥʤ��Ȥ����ʤ����ºݡ�
d35df41eac69 Initial revision
kono
parents:
diff changeset
949 goto func(arg)
d35df41eac69 Initial revision
kono
parents:
diff changeset
950 �Ǥϡ�current environment �� pushl %ebp ��stack = current env
d35df41eac69 Initial revision
kono
parents:
diff changeset
951 ���Ѥ�Ǥ���櫓�����顣
d35df41eac69 Initial revision
kono
parents:
diff changeset
952
d35df41eac69 Initial revision
kono
parents:
diff changeset
953 ������ˤ��衢
d35df41eac69 Initial revision
kono
parents:
diff changeset
954 struct p = q;
d35df41eac69 Initial revision
kono
parents:
diff changeset
955 �ϼ�������ɬ�פ����롣local�ʡ�
d35df41eac69 Initial revision
kono
parents:
diff changeset
956 code p = {func,env};
d35df41eac69 Initial revision
kono
parents:
diff changeset
957 ��ư���Ϥ�����...
d35df41eac69 Initial revision
kono
parents:
diff changeset
958
d35df41eac69 Initial revision
kono
parents:
diff changeset
959 code (*p)();
d35df41eac69 Initial revision
kono
parents:
diff changeset
960 goto (*p)(arg);
d35df41eac69 Initial revision
kono
parents:
diff changeset
961
d35df41eac69 Initial revision
kono
parents:
diff changeset
962 �Ϥ����龯����������������ϡ�goto ��env ����äƤ���ȹͤ���٤���
d35df41eac69 Initial revision
kono
parents:
diff changeset
963
d35df41eac69 Initial revision
kono
parents:
diff changeset
964 ���Τ褦�ˤ���ȡ���ˡ�
d35df41eac69 Initial revision
kono
parents:
diff changeset
965 func,env
d35df41eac69 Initial revision
kono
parents:
diff changeset
966 ���Ȥ�code�Ȥߤʤ����Ȥˤʤ롣����ϡ�object �ȸƤ֤٤�����
d35df41eac69 Initial revision
kono
parents:
diff changeset
967 ��������¸��object�Ȥ��̤���ʡ�actor �������ɤ�?
d35df41eac69 Initial revision
kono
parents:
diff changeset
968
d35df41eac69 Initial revision
kono
parents:
diff changeset
969 �����󡢤����join�������С�������DinnerBell���ʡ����������Ϥʤ����ɡ�
d35df41eac69 Initial revision
kono
parents:
diff changeset
970
d35df41eac69 Initial revision
kono
parents:
diff changeset
971 Sun Jan 9 01:40:05 JST 2000
d35df41eac69 Initial revision
kono
parents:
diff changeset
972
d35df41eac69 Initial revision
kono
parents:
diff changeset
973 local �ѿ��ν������allocation �θ���٤餻��ɬ�פ����롣
d35df41eac69 Initial revision
kono
parents:
diff changeset
974 nptr ���������Ϥ������? nptr �˽�����ե饰��­����?
d35df41eac69 Initial revision
kono
parents:
diff changeset
975
d35df41eac69 Initial revision
kono
parents:
diff changeset
976 ʸ����ǽи�����local�ѿ��ν������������ư���Ƥ����?
d35df41eac69 Initial revision
kono
parents:
diff changeset
977
d35df41eac69 Initial revision
kono
parents:
diff changeset
978 ��¤�Τ�copy�ϡ�lcheck �������٤��Ǥʤ���
d35df41eac69 Initial revision
kono
parents:
diff changeset
979
d35df41eac69 Initial revision
kono
parents:
diff changeset
980 Sun Jan 9 08:49:43 JST 2000
d35df41eac69 Initial revision
kono
parents:
diff changeset
981
d35df41eac69 Initial revision
kono
parents:
diff changeset
982 �����󡢤ʤ󤫽�����¿���ʤ������ȡ��ؿ��ƤӽФ���goto ʸ��
d35df41eac69 Initial revision
kono
parents:
diff changeset
983 ��¤�Τؤ��б�����
d35df41eac69 Initial revision
kono
parents:
diff changeset
984
d35df41eac69 Initial revision
kono
parents:
diff changeset
985 goto (*code)();
d35df41eac69 Initial revision
kono
parents:
diff changeset
986
d35df41eac69 Initial revision
kono
parents:
diff changeset
987 ����self env ��Ȥ��Τ���code ������ͤ�Ȥ��Τ�����̤���
d35df41eac69 Initial revision
kono
parents:
diff changeset
988 ɬ�פ����롣�⤷*��Ȥ�ʤ��Ȥ����label(FNAME)�Ȥζ��̤�
d35df41eac69 Initial revision
kono
parents:
diff changeset
989 �Ĥ��ʤ����������Ǥ⡢�Ķ�������⤯���Ȥˤ������顢label
d35df41eac69 Initial revision
kono
parents:
diff changeset
990 �ؤ�jump���褦�Ȼפ��ФǤ���͡�
d35df41eac69 Initial revision
kono
parents:
diff changeset
991
d35df41eac69 Initial revision
kono
parents:
diff changeset
992 ���������Ϥʤ��Ƥ⡢���ι����ʤ��statementñ�̤��������򸡽Ф���Τ�
d35df41eac69 Initial revision
kono
parents:
diff changeset
993 �ưפ�������
d35df41eac69 Initial revision
kono
parents:
diff changeset
994
d35df41eac69 Initial revision
kono
parents:
diff changeset
995 ���ФǤ��뤱�ɡ����ν������̤���1�����㽪��ʤ����ʤ���
d35df41eac69 Initial revision
kono
parents:
diff changeset
996 ��ư�������������ΤǤ��礦?
d35df41eac69 Initial revision
kono
parents:
diff changeset
997
d35df41eac69 Initial revision
kono
parents:
diff changeset
998 Mon Jan 10 09:00:12 JST 2000
d35df41eac69 Initial revision
kono
parents:
diff changeset
999
d35df41eac69 Initial revision
kono
parents:
diff changeset
1000 �����˹�¤�Τ�����ˤϡ�ɬ��ANSI-C�ˤ���ɬ�פ����롣�񤷤���
d35df41eac69 Initial revision
kono
parents:
diff changeset
1001 �ʤ���...
d35df41eac69 Initial revision
kono
parents:
diff changeset
1002
d35df41eac69 Initial revision
kono
parents:
diff changeset
1003 goto ʸ�ˤ� label, code, continuation ��3�Ĥ���롣
d35df41eac69 Initial revision
kono
parents:
diff changeset
1004 continuation = code + env
d35df41eac69 Initial revision
kono
parents:
diff changeset
1005 | label +env
d35df41eac69 Initial revision
kono
parents:
diff changeset
1006 �ʤΤ�����code/label �Ǥϡ�env �����Ƥ��ۤʤ롣�Ǥ�������򤤤���
d35df41eac69 Initial revision
kono
parents:
diff changeset
1007 ���β��ͤϤ���Τ�?
d35df41eac69 Initial revision
kono
parents:
diff changeset
1008
d35df41eac69 Initial revision
kono
parents:
diff changeset
1009 ��������code , env ��ʬΥ����Ȥ��ޤ�˴��������롣�ɤ���goto
d35df41eac69 Initial revision
kono
parents:
diff changeset
1010 �������ʤ�����餤����? ����������ñ����ñ�ʤ顢���ä�����ˡ��
d35df41eac69 Initial revision
kono
parents:
diff changeset
1011 �Ȥ�٤�����ʤ�? ������
d35df41eac69 Initial revision
kono
parents:
diff changeset
1012
d35df41eac69 Initial revision
kono
parents:
diff changeset
1013 return �δؿ���¸���Ϥʤ����������ɤ���
d35df41eac69 Initial revision
kono
parents:
diff changeset
1014 ��Ĥˤ���Τϡ�pop �����꤬����Τ��ɤ��ʤ���...
d35df41eac69 Initial revision
kono
parents:
diff changeset
1015
d35df41eac69 Initial revision
kono
parents:
diff changeset
1016 ��������ret ��env����ꤷ�����褦�ˤ������顢leave ����ɬ�פ�
d35df41eac69 Initial revision
kono
parents:
diff changeset
1017 �ʤ��ʤä��������ơ�push %ebp ������������ʬ�ϡ�lea -disp(%ebp),%sp
d35df41eac69 Initial revision
kono
parents:
diff changeset
1018 �Ǿõ��Ƥ��롣�Ȥ������Ȥϡ�jump ��function��¸��ʬ�Ϥ���ʤ�
d35df41eac69 Initial revision
kono
parents:
diff changeset
1019 �Ȥ������Ȥ��͡�
d35df41eac69 Initial revision
kono
parents:
diff changeset
1020
d35df41eac69 Initial revision
kono
parents:
diff changeset
1021 �Ǥ⡢�����ʤ���read only°����hardware support�Ǥ���Фʤ���
d35df41eac69 Initial revision
kono
parents:
diff changeset
1022
d35df41eac69 Initial revision
kono
parents:
diff changeset
1023 sched_yeilds() ������񤱤뤫��? lock ��?
d35df41eac69 Initial revision
kono
parents:
diff changeset
1024
d35df41eac69 Initial revision
kono
parents:
diff changeset
1025 ������Ǥ������ɡ���äѤ������
d35df41eac69 Initial revision
kono
parents:
diff changeset
1026
d35df41eac69 Initial revision
kono
parents:
diff changeset
1027 Wed Jan 12 16:12:27 JST 2000
d35df41eac69 Initial revision
kono
parents:
diff changeset
1028
d35df41eac69 Initial revision
kono
parents:
diff changeset
1029 ���ϡ�ANSI prototype �Ϥ��ɤ���
d35df41eac69 Initial revision
kono
parents:
diff changeset
1030 bexpr()
d35df41eac69 Initial revision
kono
parents:
diff changeset
1031 �ǡ��ؿ��Ǥΰ����ν���ȡ����Τ��Ȥ�����ν�����Ѥ�뤳�Ȥ����롣
d35df41eac69 Initial revision
kono
parents:
diff changeset
1032 ��������ȡ�������������ͥ�褵��Ƥ��ޤ�������ϡ����ޤ롣
d35df41eac69 Initial revision
kono
parents:
diff changeset
1033
d35df41eac69 Initial revision
kono
parents:
diff changeset
1034 ��������code_arg_offset �Τ褦����ˡ���ȡ�ANSI style �Ǥϡ�
d35df41eac69 Initial revision
kono
parents:
diff changeset
1035 ���äƤ��ޤ���
6
bf602558130d continuation
kono
parents: 0
diff changeset
1036
bf602558130d continuation
kono
parents: 0
diff changeset
1037 Thu Jan 13 04:46:12 JST 2000
bf602558130d continuation
kono
parents: 0
diff changeset
1038
bf602558130d continuation
kono
parents: 0
diff changeset
1039 # goto name(a,b,d,e,f);
bf602558130d continuation
kono
parents: 0
diff changeset
1040 code name { int g; ...
bf602558130d continuation
kono
parents: 0
diff changeset
1041
bf602558130d continuation
kono
parents: 0
diff changeset
1042 %esp new %esp = old %esp - 20
bf602558130d continuation
kono
parents: 0
diff changeset
1043 %ebp-20 = g code's local variable
bf602558130d continuation
kono
parents: 0
diff changeset
1044 %ebp-12 = f <- new_disp
bf602558130d continuation
kono
parents: 0
diff changeset
1045 %ebp-8 = d
bf602558130d continuation
kono
parents: 0
diff changeset
1046 %ebp-4 = d
bf602558130d continuation
kono
parents: 0
diff changeset
1047 %ebp-0 = c
bf602558130d continuation
kono
parents: 0
diff changeset
1048 %edi = b
bf602558130d continuation
kono
parents: 0
diff changeset
1049 %esi = a
bf602558130d continuation
kono
parents: 0
diff changeset
1050 %ebp = old %esp 0 disp=0 new env
bf602558130d continuation
kono
parents: 0
diff changeset
1051 local1 <----16 old local variable ( to be erased )
bf602558130d continuation
kono
parents: 0
diff changeset
1052 %edx -12 <- disp_offset
bf602558130d continuation
kono
parents: 0
diff changeset
1053 %ecx -8
bf602558130d continuation
kono
parents: 0
diff changeset
1054 %ebx -4
bf602558130d continuation
kono
parents: 0
diff changeset
1055 %ebp = %esp 0 <- old env
bf602558130d continuation
kono
parents: 0
diff changeset
1056 %eip 4 <- arg_offset
bf602558130d continuation
kono
parents: 0
diff changeset
1057
bf602558130d continuation
kono
parents: 0
diff changeset
1058
bf602558130d continuation
kono
parents: 0
diff changeset
1059 Thu Jan 13 13:38:24 JST 2000
bf602558130d continuation
kono
parents: 0
diff changeset
1060
bf602558130d continuation
kono
parents: 0
diff changeset
1061 ���������Ǥ������ɡ�test/tmp7.c ��printf ��type mismatch ��
bf602558130d continuation
kono
parents: 0
diff changeset
1062 �ʤ�ʤ������? ASNI �������Ѥ������ʤ���
7
e2c2c0fe0785 function type definition should be in global heap
kono
parents: 6
diff changeset
1063
e2c2c0fe0785 function type definition should be in global heap
kono
parents: 6
diff changeset
1064 ������ȡ��ץ����������ؤ��ΤȤ��ˤϡ��빽���̤Υǡ�����
e2c2c0fe0785 function type definition should be in global heap
kono
parents: 6
diff changeset
1065 ���ԡ����뤳�Ȥˤʤ롣����Ǥ⤤���������...
e2c2c0fe0785 function type definition should be in global heap
kono
parents: 6
diff changeset
1066
e2c2c0fe0785 function type definition should be in global heap
kono
parents: 6
diff changeset
1067 ���줴�ȡ��ɤä��ˤȤä��֤���continuation�ؤλ��Ȥߤ����ʤ��
e2c2c0fe0785 function type definition should be in global heap
kono
parents: 6
diff changeset
1068 ���Ǥ��ʤ����ʡ�
e2c2c0fe0785 function type definition should be in global heap
kono
parents: 6
diff changeset
1069
e2c2c0fe0785 function type definition should be in global heap
kono
parents: 6
diff changeset
1070 ���ԡ����Ǥ���С�environment/return ���Ȥ�ư���櫓�����顢
e2c2c0fe0785 function type definition should be in global heap
kono
parents: 6
diff changeset
1071 ����ؤλ��Ȥ����ؤ������äƤ��ɤ���͡�
e2c2c0fe0785 function type definition should be in global heap
kono
parents: 6
diff changeset
1072
8
e714bcee688b *** empty log message ***
kono
parents: 7
diff changeset
1073 Fri Jan 14 12:03:35 JST 2000
e714bcee688b *** empty log message ***
kono
parents: 7
diff changeset
1074
e714bcee688b *** empty log message ***
kono
parents: 7
diff changeset
1075 Libretto ��keyboard�����줿... control key �������ʤ�...
e714bcee688b *** empty log message ***
kono
parents: 7
diff changeset
1076
e714bcee688b *** empty log message ***
kono
parents: 7
diff changeset
1077 printf �λ��Ȥ�����ϲ�褷�ޤ�����list2 ��local��heap
e714bcee688b *** empty log message ***
kono
parents: 7
diff changeset
1078 �˳�����ƤƤ���Τ������ʤ��ä��͡�
e714bcee688b *** empty log message ***
kono
parents: 7
diff changeset
1079
e714bcee688b *** empty log message ***
kono
parents: 7
diff changeset
1080 return �ν����ϡ�goto ʸ�ǽ��������ꡢenvironment ��
e714bcee688b *** empty log message ***
kono
parents: 7
diff changeset
1081 returnto ���������ɤ��Ϥʤ���?
e714bcee688b *** empty log message ***
kono
parents: 7
diff changeset
1082
e714bcee688b *** empty log message ***
kono
parents: 7
diff changeset
1083 environment �ϼ¤�������Ǥ���ʤ�ν�����ɬ�ס�
e714bcee688b *** empty log message ***
kono
parents: 7
diff changeset
1084 new-environment() �ߤ�����library ������С�thread �ˤǤ��롣
e714bcee688b *** empty log message ***
kono
parents: 7
diff changeset
1085
e714bcee688b *** empty log message ***
kono
parents: 7
diff changeset
1086 join ��?
11
595a24e0b90e *** empty log message ***
kono
parents: 8
diff changeset
1087
595a24e0b90e *** empty log message ***
kono
parents: 8
diff changeset
1088 funcall ���Ѱդ�����ɤ��͡�
16
ca0bce3b4810 struct copy
kono
parents: 11
diff changeset
1089
ca0bce3b4810 struct copy
kono
parents: 11
diff changeset
1090 Mon Jan 17 15:23:34 JST 2000
ca0bce3b4810 struct copy
kono
parents: 11
diff changeset
1091
ca0bce3b4810 struct copy
kono
parents: 11
diff changeset
1092 struct aa f1() {
ca0bce3b4810 struct copy
kono
parents: 11
diff changeset
1093 return bb;
ca0bce3b4810 struct copy
kono
parents: 11
diff changeset
1094 }
ca0bce3b4810 struct copy
kono
parents: 11
diff changeset
1095
ca0bce3b4810 struct copy
kono
parents: 11
diff changeset
1096 �ߤ����ʤΤ�? �ؿ��η��������η��򸫤ơ�crn ��pointer���Ϥ��ơ�
ca0bce3b4810 struct copy
kono
parents: 11
diff changeset
1097 ���Ȥ�copy���Ƥ��� stack ����ࡣ
ca0bce3b4810 struct copy
kono
parents: 11
diff changeset
1098
ca0bce3b4810 struct copy
kono
parents: 11
diff changeset
1099 # bb=f1(aaa);
ca0bce3b4810 struct copy
kono
parents: 11
diff changeset
1100 movl $bb,%eax
ca0bce3b4810 struct copy
kono
parents: 11
diff changeset
1101 pushl %eax
ca0bce3b4810 struct copy
kono
parents: 11
diff changeset
1102 movl $aaa,%eax
ca0bce3b4810 struct copy
kono
parents: 11
diff changeset
1103 pushl %eax
ca0bce3b4810 struct copy
kono
parents: 11
diff changeset
1104 call main2
ca0bce3b4810 struct copy
kono
parents: 11
diff changeset
1105 popl %edx
ca0bce3b4810 struct copy
kono
parents: 11
diff changeset
1106 copy %eax,%edx,$400
ca0bce3b4810 struct copy
kono
parents: 11
diff changeset
1107 addl $400,%esp
ca0bce3b4810 struct copy
kono
parents: 11
diff changeset
1108 # return a1;
ca0bce3b4810 struct copy
kono
parents: 11
diff changeset
1109
ca0bce3b4810 struct copy
kono
parents: 11
diff changeset
1110 �����Ǥ⡢������ȡ�local�ѿ����֤����Ȥ��˺���͡�leave; ret;
ca0bce3b4810 struct copy
kono
parents: 11
diff changeset
1111 ���ƤϤ����ʤ���...
ca0bce3b4810 struct copy
kono
parents: 11
diff changeset
1112
ca0bce3b4810 struct copy
kono
parents: 11
diff changeset
1113 ������äѤꡢ�����������ϥ��ԡ����main2�˰����Ϥ��Ƥ���ߤ����͡�
ca0bce3b4810 struct copy
kono
parents: 11
diff changeset
1114 void f1(struct aa *ret) {
ca0bce3b4810 struct copy
kono
parents: 11
diff changeset
1115 *ret = bb ;
ca0bce3b4810 struct copy
kono
parents: 11
diff changeset
1116 return;
ca0bce3b4810 struct copy
kono
parents: 11
diff changeset
1117 }
ca0bce3b4810 struct copy
kono
parents: 11
diff changeset
1118 ��Ʊ����������ϴ�ñ��
ca0bce3b4810 struct copy
kono
parents: 11
diff changeset
1119 f1().a[55]
ca0bce3b4810 struct copy
kono
parents: 11
diff changeset
1120 �ߤ����ʾ��ϡ��ɽ��ѿ��˶���Ū�˼�äƤ��ޤ��ߤ����͡�����Ϥ�����...
ca0bce3b4810 struct copy
kono
parents: 11
diff changeset
1121 ���������μ������Ȥ���äȸ���������
ca0bce3b4810 struct copy
kono
parents: 11
diff changeset
1122 leal $-sizeof(struct),%esp
ca0bce3b4810 struct copy
kono
parents: 11
diff changeset
1123 pushl %esp
ca0bce3b4810 struct copy
kono
parents: 11
diff changeset
1124 �ʤ�����ɡ��ؿ��ƤӽФ�������ǤϤǤ��ʤ�����....
ca0bce3b4810 struct copy
kono
parents: 11
diff changeset
1125
ca0bce3b4810 struct copy
kono
parents: 11
diff changeset
1126 # main(ac,av)
ca0bce3b4810 struct copy
kono
parents: 11
diff changeset
1127 # int ac;
ca0bce3b4810 struct copy
kono
parents: 11
diff changeset
1128 .align 2
ca0bce3b4810 struct copy
kono
parents: 11
diff changeset
1129 .globl main
ca0bce3b4810 struct copy
kono
parents: 11
diff changeset
1130 main:
ca0bce3b4810 struct copy
kono
parents: 11
diff changeset
1131 .type main,@function
ca0bce3b4810 struct copy
kono
parents: 11
diff changeset
1132 pushl %ebp
ca0bce3b4810 struct copy
kono
parents: 11
diff changeset
1133 movl %esp,%ebp
ca0bce3b4810 struct copy
kono
parents: 11
diff changeset
1134 pushl %ebx
ca0bce3b4810 struct copy
kono
parents: 11
diff changeset
1135 pushl %ecx
ca0bce3b4810 struct copy
kono
parents: 11
diff changeset
1136 pushl %edx
ca0bce3b4810 struct copy
kono
parents: 11
diff changeset
1137 # char *av[];
ca0bce3b4810 struct copy
kono
parents: 11
diff changeset
1138 # {
ca0bce3b4810 struct copy
kono
parents: 11
diff changeset
1139 # register int i;
ca0bce3b4810 struct copy
kono
parents: 11
diff changeset
1140 # register char *p;
ca0bce3b4810 struct copy
kono
parents: 11
diff changeset
1141 # int j = 3;
ca0bce3b4810 struct copy
kono
parents: 11
diff changeset
1142 # struct { int b; void (*c)(struct aa); } q = {3,main1},r;
ca0bce3b4810 struct copy
kono
parents: 11
diff changeset
1143 #
ca0bce3b4810 struct copy
kono
parents: 11
diff changeset
1144 # j = 3;
ca0bce3b4810 struct copy
kono
parents: 11
diff changeset
1145 subl $20,%esp
ca0bce3b4810 struct copy
kono
parents: 11
diff changeset
1146
ca0bce3b4810 struct copy
kono
parents: 11
diff changeset
1147 ����subl��夫����ꤷ�Ƥ���Ok��
ca0bce3b4810 struct copy
kono
parents: 11
diff changeset
1148
ca0bce3b4810 struct copy
kono
parents: 11
diff changeset
1149 �Ǥ⡢������� jump �λ��ˤ���ʤ�? ����뤫? �����͡�������
ca0bce3b4810 struct copy
kono
parents: 11
diff changeset
1150 �¹Ի��˥����å����Ƥ��Τ��Ѥ�����
ca0bce3b4810 struct copy
kono
parents: 11
diff changeset
1151
ca0bce3b4810 struct copy
kono
parents: 11
diff changeset
1152 �ޤ�������ۤ�ɬ�פʵ�ǽ�ǤϤʤ�������ɡ�
ca0bce3b4810 struct copy
kono
parents: 11
diff changeset
1153
ca0bce3b4810 struct copy
kono
parents: 11
diff changeset
1154 �����continuation���Ϥ��Ƥ��ȸ�����ˡ���Ȥ��ʤ����ȤϤʤ������...
ca0bce3b4810 struct copy
kono
parents: 11
diff changeset
1155
ca0bce3b4810 struct copy
kono
parents: 11
diff changeset
1156 �ؿ��ƤӽФ��κǽ�ˤ�äƤ��Ф�����������ǤǤ��뤫��?
18
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1157
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1158
51
c2ef3a2fbe88 *** empty log message ***
kono
parents: 47
diff changeset
1159 Sun Feb 20 23:59:16 JST 2000
c2ef3a2fbe88 *** empty log message ***
kono
parents: 47
diff changeset
1160
c2ef3a2fbe88 *** empty log message ***
kono
parents: 47
diff changeset
1161 MIPS ��call frame
c2ef3a2fbe88 *** empty log message ***
kono
parents: 47
diff changeset
1162
c2ef3a2fbe88 *** empty log message ***
kono
parents: 47
diff changeset
1163 $sp = $fp
c2ef3a2fbe88 *** empty log message ***
kono
parents: 47
diff changeset
1164 local variables
c2ef3a2fbe88 *** empty log message ***
kono
parents: 47
diff changeset
1165 saved register (including $31 = return address)
c2ef3a2fbe88 *** empty log message ***
kono
parents: 47
diff changeset
1166
c2ef3a2fbe88 *** empty log message ***
kono
parents: 47
diff changeset
1167 mask �ϻ��Ѥ����쥸������bit pattern
c2ef3a2fbe88 *** empty log message ***
kono
parents: 47
diff changeset
1168 -4 �ϲ�?
c2ef3a2fbe88 *** empty log message ***
kono
parents: 47
diff changeset
1169
c2ef3a2fbe88 *** empty log message ***
kono
parents: 47
diff changeset
1170 18 .mask 0xc0000000,-4
c2ef3a2fbe88 *** empty log message ***
kono
parents: 47
diff changeset
1171 19 .fmask 0x00000000,0
c2ef3a2fbe88 *** empty log message ***
kono
parents: 47
diff changeset
1172 20 0000 D0FFBD27 subu $sp,$sp,48
c2ef3a2fbe88 *** empty log message ***
kono
parents: 47
diff changeset
1173 21 0004 2C00BFAF sw $31,44($sp)
c2ef3a2fbe88 *** empty log message ***
kono
parents: 47
diff changeset
1174 22 0008 2800BEAF sw $fp,40($sp)
c2ef3a2fbe88 *** empty log message ***
kono
parents: 47
diff changeset
1175 23 000c 0000000C move $fp,$sp
c2ef3a2fbe88 *** empty log message ***
kono
parents: 47
diff changeset
1176 24 0010 21F0A003 jal __main
c2ef3a2fbe88 *** empty log message ***
kono
parents: 47
diff changeset
1177 25 0014 03000224 li $2,0x00000003 # 3
c2ef3a2fbe88 *** empty log message ***
kono
parents: 47
diff changeset
1178 26 0018 000082AF sw $2,a
c2ef3a2fbe88 *** empty log message ***
kono
parents: 47
diff changeset
1179 27 001c 04000224 li $2,0x00000004 # 4
c2ef3a2fbe88 *** empty log message ***
kono
parents: 47
diff changeset
1180 28 0020 00C082AF sw $2,b
c2ef3a2fbe88 *** empty log message ***
kono
parents: 47
diff changeset
1181 29 0024 05000224 li $2,0x00000005 # 5
c2ef3a2fbe88 *** empty log message ***
kono
parents: 47
diff changeset
1182 30 0028 000082A3 sb $2,c
c2ef3a2fbe88 *** empty log message ***
kono
parents: 47
diff changeset
1183 31 002c 06000224 li $2,0x00000006 # 6
c2ef3a2fbe88 *** empty log message ***
kono
parents: 47
diff changeset
1184 32 0030 08C082A3 sb $2,d
c2ef3a2fbe88 *** empty log message ***
kono
parents: 47
diff changeset
1185 33 $L1:
c2ef3a2fbe88 *** empty log message ***
kono
parents: 47
diff changeset
1186 34 0034 21E8C003 move $sp,$fp # sp not trusted
c2ef3a2fbe88 *** empty log message ***
kono
parents: 47
diff changeset
1187 here
c2ef3a2fbe88 *** empty log message ***
kono
parents: 47
diff changeset
1188 35 0038 2C00BF8F lw $31,44($sp)
c2ef3a2fbe88 *** empty log message ***
kono
parents: 47
diff changeset
1189 36 003c 2800BE8F lw $fp,40($sp)
c2ef3a2fbe88 *** empty log message ***
kono
parents: 47
diff changeset
1190 37 0040 0800E003 addu $sp,$sp,48
c2ef3a2fbe88 *** empty log message ***
kono
parents: 47
diff changeset
1191 38 0044 3000BD27 j $31
c2ef3a2fbe88 *** empty log message ***
kono
parents: 47
diff changeset
1192 39 .end main
c2ef3a2fbe88 *** empty log message ***
kono
parents: 47
diff changeset
1193
c2ef3a2fbe88 *** empty log message ***
kono
parents: 47
diff changeset
1194 �����Ʊ���褦�ˤ���ʤ�С�regiter�λ��ѿ���ǽ��Ĵ�٤�ɬ�פ�
c2ef3a2fbe88 *** empty log message ***
kono
parents: 47
diff changeset
1195 ����Τ����ɡ�one path compiler �Ǥ��� micro-C �Ǥϡ������
c2ef3a2fbe88 *** empty log message ***
kono
parents: 47
diff changeset
1196 �Ǥ��ʤ����������äơ�enter �ϸ���Ǥ��������ɤ���
18
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1197 Mon Jan 20 18:25:27 JST 2003
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1198
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1199 3ǯ�֤���äƤʤ��Τ��衣����äƤ��?
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1200
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1201 goto ʸ�ΥХ���Ȥ�ʤ��Ȥ����ʤ���
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1202
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1203 �ޤ����ؿ������ι�¤�Τ�Ÿ��������ϡ��ɤ��äƤ��Ȥʤ��Ϥ���
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1204
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1205 goto (*code)(i+1,j,...)
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1206
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1207 �ޤ���������ʤ��Ƥ����ѿ���Ŧ�Ф��롣
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1208
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1209 foreach arg
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1210 compare
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1211
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1212 ñ��黻 ( op+const , pointer , const assign ) �ʤɤϡ������Ǹ��Ф��롣
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1213 ��Ⱦ�ϡ����Τ褦�ˤʤ�Ϥ���
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1214 �쥸�����˾褻��ʬ�����뤫��... ����ˤϿ���ʤ��Ȥ���...
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1215
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1216 ʣ���ʤ�Τϡ�����äƷ׻����Ƥ�����(get_register ����)
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1217 �����å��夫�쥸������˺�롣
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1218
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1219 �Ĥ�����������Ȥʤ롣�Ƶ�Ū�˷׻����롣
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1220
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1221 �����ȡ��礭�ʽ�ˤ�����ä�? �����ʽ�ˤ�����ä�?
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1222 code f( int a, int b, int c ) {
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1223 goto g(b,c,a);
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1224 }
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1225 �ߤ����ʤ�Ĥ���͡�
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1226
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1227 ��ư�����Τ��ĸ��Ф��롣
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1228 ���Τ���˰�ư��ɬ�פʤ�Τ��ư���Ƥ���(�Ƶ�)
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1229 ��������
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1230
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1231 ����ʤ�Ǥ����Τ�? �롼�פ��ʤ�? �����͡��롼�פ�����
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1232 get_register ���롣
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1233
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1234 ��������ȡ�
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1235
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1236 g(b,c,a) ��b�����ܤ��롣
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1237 b���������륳���ɤ�Ф��ȡ�a ������롣
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1238 a ��ɬ�פ��ɤ�����Ĵ�٤롣����ϡ������Υꥹ�Ȥ򸫤�Ф狼�롣
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1239 �������ˡ�a ���ư���롣a �ΰ�ư��򸫤ơ�
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1240 �����Ƥ���С���ư����Ok����������c
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1241 �ʤΤǡ� c �򸫤롣�� b �ˤʤ�Τǡ��롼�פ���Τ��狼��Τǡ�
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1242 b �� get_register ���롣
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1243 �ǡ�c ����ư�Ǥ��롣�ǡ�a���ư���ơ��ȤäƤ�����b��������
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1244
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1245 Tue Jan 21 22:45:09 JST 2003
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1246
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1247 �Ȥꤢ������jump ��ʣ�������롣��äȴ�ñ�ˤ��뤳�Ȥ�ͤ��롣
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1248 parser ¦�Ǥ������ٽ����Ǥ��ʤ�?
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1249
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1250 goto f(a+3,b(),c);
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1251
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1252 �ʤɤ�
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1253
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1254 a = a+3;
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1255 b = b();
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1256 goto f(a,b,c);
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1257
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1258 ���٤˴�ά�����롣���λ���f(a,b,c) ��(�Ǥ������)������
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1259 �ؿ��ΰ����ꥹ�Ȥ˶��դ��롣�Τ�̵���ʤΤǡ�ñ���ѿ�
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1260 �ޤ����
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1261
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1262 ���ޤ�ط��ʤ���������ѿ��Ϥɤ�������櫓�������äƤ���
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1263 �ߤ����͡�
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1264
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1265 ���Ȥ���ȡ����Υ����ɤȡ������Ѥ���͡����Τ⡢����ʤ�
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1266 �����ʤ��äƤ��Ȥ���
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1267
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1268 Wed Jan 22 14:33:12 JST 2003
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1269
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1270 ��äѤꡢ����Ƕɽ��ѿ������䤷������͡�
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1271
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1272 Fri Jan 31 20:30:36 JST 2003
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1273
df7fa8cee67b pass -Wall
kono
parents: 16
diff changeset
1274 �ʤ� #ifdef / #if ���ʤ��Ȥ�����ʡ���������?
25
b7a94557bf92 *** empty log message ***
kono
parents: 24
diff changeset
1275 ���ޤ�����
23
e605560e6146 Fix breaking edx,ecx on function call
kono
parents: 18
diff changeset
1276
e605560e6146 Fix breaking edx,ecx on function call
kono
parents: 18
diff changeset
1277 Tue Feb 4 01:04:12 JST 2003
e605560e6146 Fix breaking edx,ecx on function call
kono
parents: 18
diff changeset
1278
e605560e6146 Fix breaking edx,ecx on function call
kono
parents: 18
diff changeset
1279 ## while ((*chptr++ = c = getc(filep->fcb)) != '\n') {
e605560e6146 Fix breaking edx,ecx on function call
kono
parents: 18
diff changeset
1280 _1120:
e605560e6146 Fix breaking edx,ecx on function call
kono
parents: 18
diff changeset
1281 movl $10,%eax
e605560e6146 Fix breaking edx,ecx on function call
kono
parents: 18
diff changeset
1282 movl $8,%ecx
e605560e6146 Fix breaking edx,ecx on function call
kono
parents: 18
diff changeset
1283 movl filep,%edx
e605560e6146 Fix breaking edx,ecx on function call
kono
parents: 18
diff changeset
1284 addl %ecx,%edx
e605560e6146 Fix breaking edx,ecx on function call
kono
parents: 18
diff changeset
1285 movl (%edx),%edx
e605560e6146 Fix breaking edx,ecx on function call
kono
parents: 18
diff changeset
1286 pushl %edx
e605560e6146 Fix breaking edx,ecx on function call
kono
parents: 18
diff changeset
1287 xchg %edx,%eax .... edx ��$10������ (�ʤ��xchg?)
e605560e6146 Fix breaking edx,ecx on function call
kono
parents: 18
diff changeset
1288 call getc
e605560e6146 Fix breaking edx,ecx on function call
kono
parents: 18
diff changeset
1289 addl $4,%esp
e605560e6146 Fix breaking edx,ecx on function call
kono
parents: 18
diff changeset
1290 movl %eax,-20(%ebp) c ������
e605560e6146 Fix breaking edx,ecx on function call
kono
parents: 18
diff changeset
1291 movl $chptr,%ecx
e605560e6146 Fix breaking edx,ecx on function call
kono
parents: 18
diff changeset
1292 pushl %ecx
e605560e6146 Fix breaking edx,ecx on function call
kono
parents: 18
diff changeset
1293 popl %ebx
e605560e6146 Fix breaking edx,ecx on function call
kono
parents: 18
diff changeset
1294 movl (%ebx),%ecx ecx ��chptr�����
e605560e6146 Fix breaking edx,ecx on function call
kono
parents: 18
diff changeset
1295 addl $1,(%ebx)
e605560e6146 Fix breaking edx,ecx on function call
kono
parents: 18
diff changeset
1296 movb %al,(%ecx)
e605560e6146 Fix breaking edx,ecx on function call
kono
parents: 18
diff changeset
1297 subl %edx,%eax eax-edx ($10)
e605560e6146 Fix breaking edx,ecx on function call
kono
parents: 18
diff changeset
1298 je _1119
e605560e6146 Fix breaking edx,ecx on function call
kono
parents: 18
diff changeset
1299
e605560e6146 Fix breaking edx,ecx on function call
kono
parents: 18
diff changeset
1300 ���������ͳ�ʤ������...
e605560e6146 Fix breaking edx,ecx on function call
kono
parents: 18
diff changeset
1301
e605560e6146 Fix breaking edx,ecx on function call
kono
parents: 18
diff changeset
1302 edx,ecx ���˲�������㤦�ߤ����͡�
e605560e6146 Fix breaking edx,ecx on function call
kono
parents: 18
diff changeset
1303
e605560e6146 Fix breaking edx,ecx on function call
kono
parents: 18
diff changeset
1304 Tue Feb 4 12:17:07 JST 2003
e605560e6146 Fix breaking edx,ecx on function call
kono
parents: 18
diff changeset
1305
e605560e6146 Fix breaking edx,ecx on function call
kono
parents: 18
diff changeset
1306 �褦��ä�ľ������...
24
1df0bf7eb5da add esi/edi register. fix virtual register bug.
kono
parents: 23
diff changeset
1307
1df0bf7eb5da add esi/edi register. fix virtual register bug.
kono
parents: 23
diff changeset
1308 use_pointer �äơ��ʤˤ⤷�ʤ��Ƥ���������? eax,ebx ���򤱤�
1df0bf7eb5da add esi/edi register. fix virtual register bug.
kono
parents: 23
diff changeset
1309 �äƤ��Ȥ餷�����ɡ�
25
b7a94557bf92 *** empty log message ***
kono
parents: 24
diff changeset
1310
b7a94557bf92 *** empty log message ***
kono
parents: 24
diff changeset
1311 inline/�����դ� #define �ߤ����ʤ�? �֤������ϡ�local name stack ���Ѥ󤸤㤦��
b7a94557bf92 *** empty log message ***
kono
parents: 24
diff changeset
1312 Ÿ���� function �ǹԤ���
b7a94557bf92 *** empty log message ***
kono
parents: 24
diff changeset
1313
b7a94557bf92 *** empty log message ***
kono
parents: 24
diff changeset
1314 getch ���פ���ɬ�פϤ��뤬���֤����������å���ɬ�ס�
b7a94557bf92 *** empty log message ***
kono
parents: 24
diff changeset
1315
b7a94557bf92 *** empty log message ***
kono
parents: 24
diff changeset
1316
b7a94557bf92 *** empty log message ***
kono
parents: 24
diff changeset
1317 Wed Feb 5 01:16:00 JST 2003
b7a94557bf92 *** empty log message ***
kono
parents: 24
diff changeset
1318
b7a94557bf92 *** empty log message ***
kono
parents: 24
diff changeset
1319 ����������줿 struct field ������ѿ��ȽŤʤäƤ��������롣
b7a94557bf92 *** empty log message ***
kono
parents: 24
diff changeset
1320 ����㤽�������ɡ��ɤ������? (ľ�������������������ɤʤ�...)
b7a94557bf92 *** empty log message ***
kono
parents: 24
diff changeset
1321 struct ��� field ̾��offset/type ���Ȥ���ƤФ��ɤ������͡�
b7a94557bf92 *** empty log message ***
kono
parents: 24
diff changeset
1322
b7a94557bf92 *** empty log message ***
kono
parents: 24
diff changeset
1323 �ʤ�����ɡ�����̵���ι�¤�Τ⤢�뤫�顢��̾�������դ���ɬ��
b7a94557bf92 *** empty log message ***
kono
parents: 24
diff changeset
1324 �⤢�롣�Ȥ����Τϡ���̾�Τʤ���¤�Τ⤢�뤫�顣����̾�ˤϡ�
b7a94557bf92 *** empty log message ***
kono
parents: 24
diff changeset
1325 ������ꥹ�Ȥ��Ĥ��Ƥ��롣�ʤ󤫤˻Ȥ�ɬ�פ����ä���Ǥ��礦
b7a94557bf92 *** empty log message ***
kono
parents: 24
diff changeset
1326 �͡��������ɤ���̵���ˤ�äƤ�����ѿ�̾������Τ�ľ����
b7a94557bf92 *** empty log message ***
kono
parents: 24
diff changeset
1327 ���񤷤���
b7a94557bf92 *** empty log message ***
kono
parents: 24
diff changeset
1328
b7a94557bf92 *** empty log message ***
kono
parents: 24
diff changeset
1329 ����äȡ���������ɡ��ַ�̾.�ե������̾�פ���Ͽ���Ƥ��ޤ��ΤϤɤ�?
b7a94557bf92 *** empty log message ***
kono
parents: 24
diff changeset
1330 ��̾����ǽФ����Ȥ��������ޤ�����...
b7a94557bf92 *** empty log message ***
kono
parents: 24
diff changeset
1331
b7a94557bf92 *** empty log message ***
kono
parents: 24
diff changeset
1332 def ����Ͽ����Ȥ��ˡ�nptr��disp�����������ˡ�struct field list
b7a94557bf92 *** empty log message ***
kono
parents: 24
diff changeset
1333 (����ѿ�) ������ơ�type �����ˡ�field list (list3(nptr,offset,
b7a94557bf92 *** empty log message ***
kono
parents: 24
diff changeset
1334 type)) ���������ɤ���
b7a94557bf92 *** empty log message ***
kono
parents: 24
diff changeset
1335
b7a94557bf92 *** empty log message ***
kono
parents: 24
diff changeset
1336 ���Ȥϡ�strop ������type��list�򸫤�褦�ˤ�����ɤ��櫓����
b7a94557bf92 *** empty log message ***
kono
parents: 24
diff changeset
1337
b7a94557bf92 *** empty log message ***
kono
parents: 24
diff changeset
1338 ����ʤ顢��ñ��ľ����Ϥ���LUSTR/GUSTR�ʤɤζ��̤�ʤ��ʤ뤷��
b7a94557bf92 *** empty log message ***
kono
parents: 24
diff changeset
1339
b7a94557bf92 *** empty log message ***
kono
parents: 24
diff changeset
1340 Wed Feb 5 02:10:14 JST 2003
b7a94557bf92 *** empty log message ***
kono
parents: 24
diff changeset
1341
b7a94557bf92 *** empty log message ***
kono
parents: 24
diff changeset
1342 ��ư�������ͤ���������ANSI C�ˤ���Τ����ѡ��Ǥ⡢
b7a94557bf92 *** empty log message ***
kono
parents: 24
diff changeset
1343 ��ư���������餤�ʤ��ȡ�
b7a94557bf92 *** empty log message ***
kono
parents: 24
diff changeset
1344
b7a94557bf92 *** empty log message ***
kono
parents: 24
diff changeset
1345 code generation part �򡢤����ʬ�䤷�ơ�
b7a94557bf92 *** empty log message ***
kono
parents: 24
diff changeset
1346 ʣ���Υ������б��ˤ��䤹���褦�ˤ��롣
b7a94557bf92 *** empty log message ***
kono
parents: 24
diff changeset
1347 �����餯������ۤɶ�ͭ������ʬ�Ϥʤ����ɤ͡�
b7a94557bf92 *** empty log message ***
kono
parents: 24
diff changeset
1348
b7a94557bf92 *** empty log message ***
kono
parents: 24
diff changeset
1349 Sample C code �򥳥�ѥ��뤷�ơ����η�̤���(Ⱦʬ��ư��)
b7a94557bf92 *** empty log message ***
kono
parents: 24
diff changeset
1350 Micro CbC code generation part ������������ˡ���Ѱդ��롣
b7a94557bf92 *** empty log message ***
kono
parents: 24
diff changeset
1351
b7a94557bf92 *** empty log message ***
kono
parents: 24
diff changeset
1352
b7a94557bf92 *** empty log message ***
kono
parents: 24
diff changeset
1353
26
85b8648de04f *** empty log message ***
kono
parents: 25
diff changeset
1354 Thu Feb 6 11:47:03 JST 2003
25
b7a94557bf92 *** empty log message ***
kono
parents: 24
diff changeset
1355
26
85b8648de04f *** empty log message ***
kono
parents: 25
diff changeset
1356 Code Segement ��ñ�̤Ȥ��ƻȤ��Ȥ��ˡ�����ѿ��Ϥɤ�����
85b8648de04f *** empty log message ***
kono
parents: 25
diff changeset
1357 �褦��ʬ�����? static �ʤ󤫤ϰ�̣�ʤ���͡�
85b8648de04f *** empty log message ***
kono
parents: 25
diff changeset
1358
85b8648de04f *** empty log message ***
kono
parents: 25
diff changeset
1359 ������󡢼����˥��롼��ʬ�������櫓�����ɡ�
85b8648de04f *** empty log message ***
kono
parents: 25
diff changeset
1360
85b8648de04f *** empty log message ***
kono
parents: 25
diff changeset
1361 ���ȥǡ����ե�������͡��ǡ����ե����˴ؤ��Ƥϡ�
85b8648de04f *** empty log message ***
kono
parents: 25
diff changeset
1362 ����ޤ��äƤʤ��ʤ�
85b8648de04f *** empty log message ***
kono
parents: 25
diff changeset
1363
28
c6994794f084 functional macro (imcomplete)
kono
parents: 26
diff changeset
1364 Fri Feb 7 14:36:15 JST 2003
c6994794f084 functional macro (imcomplete)
kono
parents: 26
diff changeset
1365
c6994794f084 functional macro (imcomplete)
kono
parents: 26
diff changeset
1366 inline �Ǥϡ�ɬ�餺���ɽ��ѿ������ä����롣�ޤ���inline
c6994794f084 functional macro (imcomplete)
kono
parents: 26
diff changeset
1367 �����̤δؿ��Ȥ���Ÿ�����Ƥ���ɬ�פ⤢��餷����(����?)
c6994794f084 functional macro (imcomplete)
kono
parents: 26
diff changeset
1368
c6994794f084 functional macro (imcomplete)
kono
parents: 26
diff changeset
1369 #define �ͤ���
c6994794f084 functional macro (imcomplete)
kono
parents: 26
diff changeset
1370
c6994794f084 functional macro (imcomplete)
kono
parents: 26
diff changeset
1371 #define c(a,b) g(a+1,b+1)
c6994794f084 functional macro (imcomplete)
kono
parents: 26
diff changeset
1372 #define g(a,b) printf("%d %d\n",a+1,b+1);
c6994794f084 functional macro (imcomplete)
kono
parents: 26
diff changeset
1373
c6994794f084 functional macro (imcomplete)
kono
parents: 26
diff changeset
1374 main() {
c6994794f084 functional macro (imcomplete)
kono
parents: 26
diff changeset
1375 int a,b;
c6994794f084 functional macro (imcomplete)
kono
parents: 26
diff changeset
1376 a =1; b = 3;
c6994794f084 functional macro (imcomplete)
kono
parents: 26
diff changeset
1377 c(a,b);
c6994794f084 functional macro (imcomplete)
kono
parents: 26
diff changeset
1378 }
c6994794f084 functional macro (imcomplete)
kono
parents: 26
diff changeset
1379
c6994794f084 functional macro (imcomplete)
kono
parents: 26
diff changeset
1380 local #define ����������͡�g ����� a ���Ф��褿���ˤϡ�
c6994794f084 functional macro (imcomplete)
kono
parents: 26
diff changeset
1381 c ��a ���֤������ϵ����äƤϤ����ʤ����Ȥ������Ȥϡ�c
c6994794f084 functional macro (imcomplete)
kono
parents: 26
diff changeset
1382 ���֤�������g ���Ϥޤ����˽��äƤ���ɬ�פ����롣dynamic
c6994794f084 functional macro (imcomplete)
kono
parents: 26
diff changeset
1383 scope �ʤ�����顢assoc �ξ�褻���ɤ��Ϥ���
c6994794f084 functional macro (imcomplete)
kono
parents: 26
diff changeset
1384 macro ��level��������ơ������٥�Ǥϡ����������Ÿ��
c6994794f084 functional macro (imcomplete)
kono
parents: 26
diff changeset
1385 ��Ԥ�ʤ��Ȥ�����ˡ���ɤ����ʡ�
c6994794f084 functional macro (imcomplete)
kono
parents: 26
diff changeset
1386
c6994794f084 functional macro (imcomplete)
kono
parents: 26
diff changeset
1387 c(a,b) => a=>"a+1", b=>"b+1"
c6994794f084 functional macro (imcomplete)
kono
parents: 26
diff changeset
1388 g(a,b) => (a=>"a+1+1",a=>"a+1"), (b=>"b+1+1",a=>"a+1")
c6994794f084 functional macro (imcomplete)
kono
parents: 26
diff changeset
1389
c6994794f084 functional macro (imcomplete)
kono
parents: 26
diff changeset
1390 �ߤ����ʴ���?
c6994794f084 functional macro (imcomplete)
kono
parents: 26
diff changeset
1391
c6994794f084 functional macro (imcomplete)
kono
parents: 26
diff changeset
1392 ��äѤ�ؿ����Ϥǥޥ����������餻��Τ�̵������? ���ɤߤ�����㤦����
c6994794f084 functional macro (imcomplete)
kono
parents: 26
diff changeset
1393
c6994794f084 functional macro (imcomplete)
kono
parents: 26
diff changeset
1394 Sat Feb 8 00:53:52 JST 2003
c6994794f084 functional macro (imcomplete)
kono
parents: 26
diff changeset
1395
c6994794f084 functional macro (imcomplete)
kono
parents: 26
diff changeset
1396 macro ������ޤǽ񤭤ޤ������֤�������ޥ������ƤӽФ��줿
c6994794f084 functional macro (imcomplete)
kono
parents: 26
diff changeset
1397 ������ cheap ���֤��ȡ�������ä��륿���ߥ󥰤��ʤ���
c6994794f084 functional macro (imcomplete)
kono
parents: 26
diff changeset
1398 ��������malloc���Ƥ��ɤ���..
c6994794f084 functional macro (imcomplete)
kono
parents: 26
diff changeset
1399
c6994794f084 functional macro (imcomplete)
kono
parents: 26
diff changeset
1400 chptrsave ��list�ˤ���ɬ�פ����롣list ���ɤ���
c6994794f084 functional macro (imcomplete)
kono
parents: 26
diff changeset
1401
c6994794f084 functional macro (imcomplete)
kono
parents: 26
diff changeset
1402 ��äѤ�macro level�򸫤ơ���ʬ�Ȱ��פ���assoc value�ޤ�
c6994794f084 functional macro (imcomplete)
kono
parents: 26
diff changeset
1403 �귫�ä��ִ������Ǥ��礦����������С��֤�������ɬ�פ�̵����
c6994794f084 functional macro (imcomplete)
kono
parents: 26
diff changeset
1404 �Ȥ������Ȥϡ�local_define ��mflags���Ǽ����ɬ�פ����롣
29
160e20394f80 macro function (imcomplete)
kono
parents: 28
diff changeset
1405
160e20394f80 macro function (imcomplete)
kono
parents: 28
diff changeset
1406 c(a,b) => a=>"a", b=>"b"
160e20394f80 macro function (imcomplete)
kono
parents: 28
diff changeset
1407 a=>"a" .. mflag == 1
160e20394f80 macro function (imcomplete)
kono
parents: 28
diff changeset
1408 g(a,b) => (a=>"a+1+1",a=>"a+1"), (b=>"b+1+1",a=>"a+1")
160e20394f80 macro function (imcomplete)
kono
parents: 28
diff changeset
1409 a=>"a+1" .. mflag == 2
160e20394f80 macro function (imcomplete)
kono
parents: 28
diff changeset
1410
160e20394f80 macro function (imcomplete)
kono
parents: 28
diff changeset
1411 macro �Τ�Ȥ�nptr ���ĤäƤʤ��ȡ����ꥸ�ʥ���֤��ʤ�����
160e20394f80 macro function (imcomplete)
kono
parents: 28
diff changeset
1412 �ꥸ�ʥ�ϡ�sc �ʤɤ��˲�����Ƥ��ޤ����äƤ��Ȥϡ�local macro
160e20394f80 macro function (imcomplete)
kono
parents: 28
diff changeset
1413 �ϡ�local table ������ƤϤ����ʤ��äƤ��Ȥ���͡��äƤ��Ȥϡ�
160e20394f80 macro function (imcomplete)
kono
parents: 28
diff changeset
1414 macro table �ϡ���ȤΤȤ��̤��Ѱդ���ɬ�פ����롣
160e20394f80 macro function (imcomplete)
kono
parents: 28
diff changeset
1415
160e20394f80 macro function (imcomplete)
kono
parents: 28
diff changeset
1416 #define c(a,b) g(a+1,b+1)
160e20394f80 macro function (imcomplete)
kono
parents: 28
diff changeset
1417 #define g(a,b) printf("%d %d\n",a+2,b+2);
160e20394f80 macro function (imcomplete)
kono
parents: 28
diff changeset
1418
160e20394f80 macro function (imcomplete)
kono
parents: 28
diff changeset
1419 main() {
160e20394f80 macro function (imcomplete)
kono
parents: 28
diff changeset
1420 int a,b; a ... local
160e20394f80 macro function (imcomplete)
kono
parents: 28
diff changeset
1421 a =1; b = 3;
160e20394f80 macro function (imcomplete)
kono
parents: 28
diff changeset
1422 #ifndef a
160e20394f80 macro function (imcomplete)
kono
parents: 28
diff changeset
1423 c(a, a = "a".. macro mflag==1
160e20394f80 macro function (imcomplete)
kono
parents: 28
diff changeset
1424 g(a,
160e20394f80 macro function (imcomplete)
kono
parents: 28
diff changeset
1425 a="a+1" mflag==2
160e20394f80 macro function (imcomplete)
kono
parents: 28
diff changeset
1426 ^ a = "a" mflag==1
160e20394f80 macro function (imcomplete)
kono
parents: 28
diff changeset
1427 While replacing a in g's body, a should not
160e20394f80 macro function (imcomplete)
kono
parents: 28
diff changeset
1428 be replaced to (original) "a", should be c's a.
160e20394f80 macro function (imcomplete)
kono
parents: 28
diff changeset
1429 b);
160e20394f80 macro function (imcomplete)
kono
parents: 28
diff changeset
1430 /* 3,5 expected */
160e20394f80 macro function (imcomplete)
kono
parents: 28
diff changeset
1431 #endif
160e20394f80 macro function (imcomplete)
kono
parents: 28
diff changeset
1432 }
160e20394f80 macro function (imcomplete)
kono
parents: 28
diff changeset
1433
160e20394f80 macro function (imcomplete)
kono
parents: 28
diff changeset
1434 �����ࡣ��䤳������
160e20394f80 macro function (imcomplete)
kono
parents: 28
diff changeset
1435
160e20394f80 macro function (imcomplete)
kono
parents: 28
diff changeset
1436 main()
160e20394f80 macro function (imcomplete)
kono
parents: 28
diff changeset
1437 c(a,b) mflag++
160e20394f80 macro function (imcomplete)
kono
parents: 28
diff changeset
1438 a=>"a" mflag ==1
160e20394f80 macro function (imcomplete)
kono
parents: 28
diff changeset
1439 g(a,b) mflag++;
160e20394f80 macro function (imcomplete)
kono
parents: 28
diff changeset
1440 a=>"a+1" mflag ==2
160e20394f80 macro function (imcomplete)
kono
parents: 28
diff changeset
1441 ^ is replaced by c's "a" not g's a;
160e20394f80 macro function (imcomplete)
kono
parents: 28
diff changeset
1442 ���ä��� mflag level n ��Ÿ�������顢����� mflag level n-1 �Ȥʤ롣
160e20394f80 macro function (imcomplete)
kono
parents: 28
diff changeset
1443
30
20ed2786a276 still macro
kono
parents: 29
diff changeset
1444 Sat Feb 8 18:13:43 JST 2003
29
160e20394f80 macro function (imcomplete)
kono
parents: 28
diff changeset
1445
30
20ed2786a276 still macro
kono
parents: 29
diff changeset
1446 ����������mflag �ޤǤϥǥХå�������.... mflag ���ᤷ�Ƥʤ��󤸤�ʤ���?
29
160e20394f80 macro function (imcomplete)
kono
parents: 28
diff changeset
1447
31
8b87de87eb54 *** empty log message ***
kono
parents: 30
diff changeset
1448 ---c(a,b)----------------------- mflag ==1
8b87de87eb54 *** empty log message ***
kono
parents: 30
diff changeset
1449 a=>hoge, b=>hoga (mflag==1)
8b87de87eb54 *** empty log message ***
kono
parents: 30
diff changeset
1450 ----g(ac,bc)----------------- mflag ==2
8b87de87eb54 *** empty log message ***
kono
parents: 30
diff changeset
1451 ac=>goge, bc=>goga(mflag==2)
8b87de87eb54 *** empty log message ***
kono
parents: 30
diff changeset
1452 ----printf(a,b)---------- mflag ==3
8b87de87eb54 *** empty log message ***
kono
parents: 30
diff changeset
1453 a=>poge, b=>poga(mflag==3)
29
160e20394f80 macro function (imcomplete)
kono
parents: 28
diff changeset
1454
30
20ed2786a276 still macro
kono
parents: 29
diff changeset
1455 g ���ƤӽФ����ȡ�ac,bc �� mflag==1 �ǤΤ��ִ�����롣
29
160e20394f80 macro function (imcomplete)
kono
parents: 28
diff changeset
1456
31
8b87de87eb54 *** empty log message ***
kono
parents: 30
diff changeset
1457 ����ƥ����Ȥ��֤�������ȡ�������֤��������ޥ�����mflag level
8b87de87eb54 *** empty log message ***
kono
parents: 30
diff changeset
1458 (�Ĥޤ��ľ��ʤ���٥�)�ˤʤ롣
8b87de87eb54 *** empty log message ***
kono
parents: 30
diff changeset
1459 �֤��������ä��顢����level���᤹��
8b87de87eb54 *** empty log message ***
kono
parents: 30
diff changeset
1460
8b87de87eb54 *** empty log message ***
kono
parents: 30
diff changeset
1461 mflag==2��level �Ǥϡ�mflag==2��local macro��Ÿ���������ʤ���
8b87de87eb54 *** empty log message ***
kono
parents: 30
diff changeset
1462
8b87de87eb54 *** empty log message ***
kono
parents: 30
diff changeset
1463 �֤�������ȡ�mflag level 1 �ˤʤ�Τǡ������� mflag==1 ��local
8b87de87eb54 *** empty log message ***
kono
parents: 30
diff changeset
1464 macro ��Ÿ�����롣mflag==0 �Ͼ��Ÿ����Ԥ���
8b87de87eb54 *** empty log message ***
kono
parents: 30
diff changeset
1465
32
b35787d8a442 macro initialization
kono
parents: 31
diff changeset
1466 Sun Feb 9 11:35:23 JST 2003
31
8b87de87eb54 *** empty log message ***
kono
parents: 30
diff changeset
1467
32
b35787d8a442 macro initialization
kono
parents: 31
diff changeset
1468 �����󡢤ʤ�type����list ��CHAR�ʤɤ��������äƤ��뤸���
b35787d8a442 macro initialization
kono
parents: 31
diff changeset
1469 int save = chptrsave;
b35787d8a442 macro initialization
kono
parents: 31
diff changeset
1470 �ǡ�chptrsave ����$chptrsave �ˤʤäƤ��ޤ���
33
8500dbb69dd9 bad macro processing. give up this method.
kono
parents: 32
diff changeset
1471
8500dbb69dd9 bad macro processing. give up this method.
kono
parents: 32
diff changeset
1472 Sun Feb 9 22:33:36 JST 2003
8500dbb69dd9 bad macro processing. give up this method.
kono
parents: 32
diff changeset
1473
8500dbb69dd9 bad macro processing. give up this method.
kono
parents: 32
diff changeset
1474
8500dbb69dd9 bad macro processing. give up this method.
kono
parents: 32
diff changeset
1475 #define car(e) (heap[(int)(e)])
8500dbb69dd9 bad macro processing. give up this method.
kono
parents: 32
diff changeset
1476 #define cadr(e) (heap[((int)(e))+1])
8500dbb69dd9 bad macro processing. give up this method.
kono
parents: 32
diff changeset
1477 car(cadr(e))
8500dbb69dd9 bad macro processing. give up this method.
kono
parents: 32
diff changeset
1478
8500dbb69dd9 bad macro processing. give up this method.
kono
parents: 32
diff changeset
1479 ������
8500dbb69dd9 bad macro processing. give up this method.
kono
parents: 32
diff changeset
1480 car ->
8500dbb69dd9 bad macro processing. give up this method.
kono
parents: 32
diff changeset
1481 #define e cadr(e) (mleve=1)
8500dbb69dd9 bad macro processing. give up this method.
kono
parents: 32
diff changeset
1482 cadr ->
8500dbb69dd9 bad macro processing. give up this method.
kono
parents: 32
diff changeset
1483 #define e e (mleve=2)
8500dbb69dd9 bad macro processing. give up this method.
kono
parents: 32
diff changeset
1484
8500dbb69dd9 bad macro processing. give up this method.
kono
parents: 32
diff changeset
1485 �थ�����졢���ޤ������ʤ��󤸤�󡣤��ޤä��ʤ���
8500dbb69dd9 bad macro processing. give up this method.
kono
parents: 32
diff changeset
1486
8500dbb69dd9 bad macro processing. give up this method.
kono
parents: 32
diff changeset
1487 #define c(a,b) g(a+1,b+1)
8500dbb69dd9 bad macro processing. give up this method.
kono
parents: 32
diff changeset
1488 #define g(a,b) printf("%d %d\n",a+1,b+1);
8500dbb69dd9 bad macro processing. give up this method.
kono
parents: 32
diff changeset
1489 c(a, b);
8500dbb69dd9 bad macro processing. give up this method.
kono
parents: 32
diff changeset
1490
8500dbb69dd9 bad macro processing. give up this method.
kono
parents: 32
diff changeset
1491 ���ä�����ᤸ��󡣤ա��ࡣlisp interpreter �Τ褦��
8500dbb69dd9 bad macro processing. give up this method.
kono
parents: 32
diff changeset
1492 ���Ф����Ϥ��ʤ�����ɡ�
36
9f89cef85b41 *** empty log message ***
kono
parents: 33
diff changeset
1493
9f89cef85b41 *** empty log message ***
kono
parents: 33
diff changeset
1494 Mon Feb 10 08:10:25 JST 2003
9f89cef85b41 *** empty log message ***
kono
parents: 33
diff changeset
1495
9f89cef85b41 *** empty log message ***
kono
parents: 33
diff changeset
1496 ��ɡ�list base ��interpreter ��������ޤ�����������ʤ�����
9f89cef85b41 *** empty log message ***
kono
parents: 33
diff changeset
1497 ������ˡ�Ǥ⡢��ĥ��ФǤ����Ǥ��礦���ɤ͡�
9f89cef85b41 *** empty log message ***
kono
parents: 33
diff changeset
1498
39
c63c4fdeb9a7 struct done.
kono
parents: 36
diff changeset
1499 Tue Feb 11 13:50:03 JST 2003
c63c4fdeb9a7 struct done.
kono
parents: 36
diff changeset
1500
c63c4fdeb9a7 struct done.
kono
parents: 36
diff changeset
1501 struct copy ������... �ؿ���struct���֤��Ȥ��ˡ�����������ä�
c63c4fdeb9a7 struct done.
kono
parents: 36
diff changeset
1502 �Ѥ�Ǥ����ΤǤϡ��������ͤ����ԡ�����Ƥ��ޤ��������Ȥǡ�
c63c4fdeb9a7 struct done.
kono
parents: 36
diff changeset
1503 �����å��򤿤�����֤��Ȥ��ˤ��ޤ�����
c63c4fdeb9a7 struct done.
kono
parents: 36
diff changeset
1504
c63c4fdeb9a7 struct done.
kono
parents: 36
diff changeset
1505 function call �λ��ˡ������η��Υ����å��򤷤Ƥʤ�
c63c4fdeb9a7 struct done.
kono
parents: 36
diff changeset
1506
c63c4fdeb9a7 struct done.
kono
parents: 36
diff changeset
1507 type �� -1 ��heap�ΰ��������ߤ��Ƥ����Ĥ�����..
c63c4fdeb9a7 struct done.
kono
parents: 36
diff changeset
1508 ��äѤޤ����󤸤�ʤ���?
c63c4fdeb9a7 struct done.
kono
parents: 36
diff changeset
1509
c63c4fdeb9a7 struct done.
kono
parents: 36
diff changeset
1510 temproal struct �Ϻ����ѤǤ��������ɡ�disp���ѹ����Ǥ��ʤ��Τ�
c63c4fdeb9a7 struct done.
kono
parents: 36
diff changeset
1511 ��������뤷���ʤ����礭���Ȥ��������������ʤ�Ƥ���������
45
b9266c88495c *** empty log message ***
kono
parents: 42
diff changeset
1512 ���Ϥ��뤱�ɡ�(��������ȡ����ä��褿�ͤؤΥݥ��󥿤�Ȥ��ʤ�
b9266c88495c *** empty log message ***
kono
parents: 42
diff changeset
1513 �ʤ뤬.... �̤ˤ�����͡�����ͤ��켫�Ȥ�ľ�� return ����
b9266c88495c *** empty log message ***
kono
parents: 42
diff changeset
1514 ����������礦�֤ʤϤ�)
b9266c88495c *** empty log message ***
kono
parents: 42
diff changeset
1515
b9266c88495c *** empty log message ***
kono
parents: 42
diff changeset
1516 ��ɡ��ƽ�¦�ǡ��ΰ����ݤ��ư����Ϥ����Ȥˤ��ޤ�����������ˡ���ȡ�
b9266c88495c *** empty log message ***
kono
parents: 42
diff changeset
1517 �����ΤȤ������٥��ԡ�����ɬ�פ�ʤ���
39
c63c4fdeb9a7 struct done.
kono
parents: 36
diff changeset
1518
c63c4fdeb9a7 struct done.
kono
parents: 36
diff changeset
1519 register ����Ѥ��Ƥ��뤫��������ʤ��ơ��ºݤ�creg/dreg��
c63c4fdeb9a7 struct done.
kono
parents: 36
diff changeset
1520 �ͤ����뤫�ɤ����򵭲�����ɬ�פ����롣
42
a89cf0d6904f regv assop
kono
parents: 39
diff changeset
1521
a89cf0d6904f regv assop
kono
parents: 39
diff changeset
1522 Wed Feb 12 11:09:22 JST 2003
a89cf0d6904f regv assop
kono
parents: 39
diff changeset
1523
a89cf0d6904f regv assop
kono
parents: 39
diff changeset
1524 ��������ɤ�... ��äѤꥢ�ɥۥå��˼¸�����Τ��񤷤��󤸤�ʤ���?
a89cf0d6904f regv assop
kono
parents: 39
diff changeset
1525
a89cf0d6904f regv assop
kono
parents: 39
diff changeset
1526 �ޤ��ͤ���register �ξ��γ��ݤȡ���̿���̤����顢�����
a89cf0d6904f regv assop
kono
parents: 39
diff changeset
1527 ����������ɡ�regs flag �����Ǥʤ�Ȥ��ʤ�ʤ��Τ��ʡ�
a89cf0d6904f regv assop
kono
parents: 39
diff changeset
1528 ���������ѹ��ϤϤޤ뤬��������
45
b9266c88495c *** empty log message ***
kono
parents: 42
diff changeset
1529
b9266c88495c *** empty log message ***
kono
parents: 42
diff changeset
1530 Thu Feb 13 18:37:36 JST 2003
b9266c88495c *** empty log message ***
kono
parents: 42
diff changeset
1531
b9266c88495c *** empty log message ***
kono
parents: 42
diff changeset
1532 ���ơ��������� jump �ˤȤ꤫����ޤ�����
b9266c88495c *** empty log message ***
kono
parents: 42
diff changeset
1533
b9266c88495c *** empty log message ***
kono
parents: 42
diff changeset
1534 ��¤�Τΰ����Ϥ��Υ��������󥹤˻Ȥ��ɽ��ѿ��ΰ��֤�gcc�Ȱ㤦...
b9266c88495c *** empty log message ***
kono
parents: 42
diff changeset
1535
b9266c88495c *** empty log message ***
kono
parents: 42
diff changeset
1536 �������� register �Ϲ�¤�Τˤ��٤����͡�
b9266c88495c *** empty log message ***
kono
parents: 42
diff changeset
1537 struct register {
b9266c88495c *** empty log message ***
kono
parents: 42
diff changeset
1538 int used;
b9266c88495c *** empty log message ***
kono
parents: 42
diff changeset
1539 int valued;
b9266c88495c *** empty log message ***
kono
parents: 42
diff changeset
1540 char *name;
b9266c88495c *** empty log message ***
kono
parents: 42
diff changeset
1541 char *wname;
b9266c88495c *** empty log message ***
kono
parents: 42
diff changeset
1542 char *bname;
b9266c88495c *** empty log message ***
kono
parents: 42
diff changeset
1543 int type; /* register variable or not */
b9266c88495c *** empty log message ***
kono
parents: 42
diff changeset
1544 int number;
b9266c88495c *** empty log message ***
kono
parents: 42
diff changeset
1545 }
b9266c88495c *** empty log message ***
kono
parents: 42
diff changeset
1546 virtual/real �ϡ��ɤ����롣
46
b1c8ac8c308d fix cascading struct retrun. Now it should be compatible with gcc
kono
parents: 45
diff changeset
1547
b1c8ac8c308d fix cascading struct retrun. Now it should be compatible with gcc
kono
parents: 45
diff changeset
1548 Sat Feb 15 14:00:03 JST 2003
b1c8ac8c308d fix cascading struct retrun. Now it should be compatible with gcc
kono
parents: 45
diff changeset
1549
b1c8ac8c308d fix cascading struct retrun. Now it should be compatible with gcc
kono
parents: 45
diff changeset
1550 fdecl_struct ��ʸŪ�˰������и�����Ȥ��˹Ԥ��ȡ�int *f(int
b1c8ac8c308d fix cascading struct retrun. Now it should be compatible with gcc
kono
parents: 45
diff changeset
1551 a) �ʤɤǡ�* ��ɾ�����������ˡ�int a��ɾ�����줷�ޤ���*obj
b1c8ac8c308d fix cascading struct retrun. Now it should be compatible with gcc
kono
parents: 45
diff changeset
1552 ��obj ��ɾ��������ʤ���f�Υ����פ����ꤷ�ʤ���int*f()[] ��
b1c8ac8c308d fix cascading struct retrun. Now it should be compatible with gcc
kono
parents: 45
diff changeset
1553 �����ʾ�礬���뤫�顣(?) �ʤΤǡ�gcc �ȡ��������뤿��ˤϡ�
b1c8ac8c308d fix cascading struct retrun. Now it should be compatible with gcc
kono
parents: 45
diff changeset
1554 arg ����Ƭ�� fdecl_struct ��Ԥ���ˡ�ǤϤ���ǡ�fdecl ��Ǥ�
b1c8ac8c308d fix cascading struct retrun. Now it should be compatible with gcc
kono
parents: 45
diff changeset
1555 �Ȥ��齤�����������ɤ���
b1c8ac8c308d fix cascading struct retrun. Now it should be compatible with gcc
kono
parents: 45
diff changeset
1556
b1c8ac8c308d fix cascading struct retrun. Now it should be compatible with gcc
kono
parents: 45
diff changeset
1557 fix ���褦�ˤ�����ꥹ�Ȥʤ�ơ�¸�ߤ��ʤ������!
b1c8ac8c308d fix cascading struct retrun. Now it should be compatible with gcc
kono
parents: 45
diff changeset
1558
b1c8ac8c308d fix cascading struct retrun. Now it should be compatible with gcc
kono
parents: 45
diff changeset
1559 varargs ���������ΤϤ��ɤ���������...
b1c8ac8c308d fix cascading struct retrun. Now it should be compatible with gcc
kono
parents: 45
diff changeset
1560
b1c8ac8c308d fix cascading struct retrun. Now it should be compatible with gcc
kono
parents: 45
diff changeset
1561 rvalue(expr(),type) �Ǥϡ�expr() ��type��rvalue�˰����Ϥ���
b1c8ac8c308d fix cascading struct retrun. Now it should be compatible with gcc
kono
parents: 45
diff changeset
1562 �����Ǥ⡢type ������ѿ��ˤ���ȡ�rvalue��ۤʤ륿���פǸ�
b1c8ac8c308d fix cascading struct retrun. Now it should be compatible with gcc
kono
parents: 45
diff changeset
1563 �ӽФ��Ȥ���type���ѹ�����ɬ�פ����롣����rvalue��type �ΰ�
b1c8ac8c308d fix cascading struct retrun. Now it should be compatible with gcc
kono
parents: 45
diff changeset
1564 ���ϡ����ʤ�Ϥޤä����Ȥ�����Τǡ�rvalue(int e,int type)��
b1c8ac8c308d fix cascading struct retrun. Now it should be compatible with gcc
kono
parents: 45
diff changeset
1565 �����ɤ����ȤϳΤ��ʤ����...
47
f6b5e4f1a962 *** empty log message ***
kono
parents: 46
diff changeset
1566
f6b5e4f1a962 *** empty log message ***
kono
parents: 46
diff changeset
1567 struct_push ��register�ΰ�����ʣ���������ʤ󤫡���ä�
f6b5e4f1a962 *** empty log message ***
kono
parents: 46
diff changeset
1568 ��ñ�ˤʤ�ʤ���?
51
c2ef3a2fbe88 *** empty log message ***
kono
parents: 47
diff changeset
1569
c2ef3a2fbe88 *** empty log message ***
kono
parents: 47
diff changeset
1570 Sun Feb 16 07:58:23 JST 2003
c2ef3a2fbe88 *** empty log message ***
kono
parents: 47
diff changeset
1571
c2ef3a2fbe88 *** empty log message ***
kono
parents: 47
diff changeset
1572 �������ʤ����ɤ�����ȸ��äơ�������
c2ef3a2fbe88 *** empty log message ***
kono
parents: 47
diff changeset
1573 �Υꥹ�Ȥ�������Ƥϡ���񤭤��ɤ��ʤ���
52
ddaa1aa5b49b parallel assignment done (not circular dependency)
kono
parents: 51
diff changeset
1574
ddaa1aa5b49b parallel assignment done (not circular dependency)
kono
parents: 51
diff changeset
1575 Sun Feb 16 22:55:58 JST 2003
ddaa1aa5b49b parallel assignment done (not circular dependency)
kono
parents: 51
diff changeset
1576
ddaa1aa5b49b parallel assignment done (not circular dependency)
kono
parents: 51
diff changeset
1577 vdisp �äƤʤ���ä����?
ddaa1aa5b49b parallel assignment done (not circular dependency)
kono
parents: 51
diff changeset
1578
ddaa1aa5b49b parallel assignment done (not circular dependency)
kono
parents: 51
diff changeset
1579 Mon Feb 17 12:35:39 JST 2003
ddaa1aa5b49b parallel assignment done (not circular dependency)
kono
parents: 51
diff changeset
1580
ddaa1aa5b49b parallel assignment done (not circular dependency)
kono
parents: 51
diff changeset
1581 ���������Ͻ��褿�ߤ����������Ͼ�������Τ���ˤ��٤��ʤΤ�?
ddaa1aa5b49b parallel assignment done (not circular dependency)
kono
parents: 51
diff changeset
1582 �ޤ����Ǥ���㤤��������ɡ������򤱤��Τ��礭���ΤϤ���
ddaa1aa5b49b parallel assignment done (not circular dependency)
kono
parents: 51
diff changeset
1583 ����͡�
53
64a4e3789fd2 parallel assign works.
kono
parents: 52
diff changeset
1584
64a4e3789fd2 parallel assign works.
kono
parents: 52
diff changeset
1585 Tue Feb 18 11:56:10 JST 2003
64a4e3789fd2 parallel assign works.
kono
parents: 52
diff changeset
1586
64a4e3789fd2 parallel assign works.
kono
parents: 52
diff changeset
1587 overraped �Ѥ� emit_copy
64a4e3789fd2 parallel assign works.
kono
parents: 52
diff changeset
1588 float/double
64a4e3789fd2 parallel assign works.
kono
parents: 52
diff changeset
1589 long long
64a4e3789fd2 parallel assign works.
kono
parents: 52
diff changeset
1590
64a4e3789fd2 parallel assign works.
kono
parents: 52
diff changeset
1591 Tue Feb 18 19:34:31 JST 2003
64a4e3789fd2 parallel assign works.
kono
parents: 52
diff changeset
1592
64a4e3789fd2 parallel assign works.
kono
parents: 52
diff changeset
1593 code argument ������ȿž������ȡ�list2(LVAR,offset)
64a4e3789fd2 parallel assign works.
kono
parents: 52
diff changeset
1594 ��offset�����ɥ쥹�������Ȱ��פ��Ƥ���Ȥ�������
64a4e3789fd2 parallel assign works.
kono
parents: 52
diff changeset
1595 ����롣����ǡ���¤�Τγ�Ǽ���������Ƥ��ޤ�...
64a4e3789fd2 parallel assign works.
kono
parents: 52
diff changeset
1596
64a4e3789fd2 parallel assign works.
kono
parents: 52
diff changeset
1597 �Ȥ������Ȥ�... def(n) ��code�λ���argument�ϡ��ɽ��ѿ���Ʊ��
64a4e3789fd2 parallel assign works.
kono
parents: 52
diff changeset
1598 �����ǥޥ��ʥ����ǽ������������ɤ���
64a4e3789fd2 parallel assign works.
kono
parents: 52
diff changeset
1599
64a4e3789fd2 parallel assign works.
kono
parents: 52
diff changeset
1600 �Ǥ����ߤ������Ǥ⤵��
64a4e3789fd2 parallel assign works.
kono
parents: 52
diff changeset
1601
64a4e3789fd2 parallel assign works.
kono
parents: 52
diff changeset
1602 int main( int ac, char *av[])
64a4e3789fd2 parallel assign works.
kono
parents: 52
diff changeset
1603 {
64a4e3789fd2 parallel assign works.
kono
parents: 52
diff changeset
1604 int n;
64a4e3789fd2 parallel assign works.
kono
parents: 52
diff changeset
1605 goto arg1(0,1,2,3,4,return,environment);
64a4e3789fd2 parallel assign works.
kono
parents: 52
diff changeset
1606 }
64a4e3789fd2 parallel assign works.
kono
parents: 52
diff changeset
1607
64a4e3789fd2 parallel assign works.
kono
parents: 52
diff changeset
1608 �äơ����ä� return ʸ���ʤ��ȡ�ʸ���
64a4e3789fd2 parallel assign works.
kono
parents: 52
diff changeset
1609 �������͡����ࡣ
64a4e3789fd2 parallel assign works.
kono
parents: 52
diff changeset
1610
55
94564b45c4f3 all save implementation of parallel assignment
kono
parents: 53
diff changeset
1611 post processing �������overrap���Ƥʤ��Ȥ����ݾڤ��ʤ���
94564b45c4f3 all save implementation of parallel assignment
kono
parents: 53
diff changeset
1612
57
3d7f199e99d0 struct handling
kono
parents: 55
diff changeset
1613 Wed Feb 19 15:38:55 JST 2003
3d7f199e99d0 struct handling
kono
parents: 55
diff changeset
1614
3d7f199e99d0 struct handling
kono
parents: 55
diff changeset
1615 ��ʬ���ȤȤ�overrrap�򸫤Ƥʤ��Τǡ�
3d7f199e99d0 struct handling
kono
parents: 55
diff changeset
1616 struct a a,int i
3d7f199e99d0 struct handling
kono
parents: 55
diff changeset
1617 int i,struct a a
3d7f199e99d0 struct handling
kono
parents: 55
diff changeset
1618 �ߤ����ʻ��˼�ʬ���Ȥ�����Ƥ��ޤ����ʤΤǡ�emit_copy
3d7f199e99d0 struct handling
kono
parents: 55
diff changeset
1619 ���������������򸫤Ʋ����ʤ��褦�˽�������ɬ�פ����롣
3d7f199e99d0 struct handling
kono
parents: 55
diff changeset
1620
59
eeca07d1b1c2 *** empty log message ***
kono
parents: 57
diff changeset
1621 call bcopy �Ǥ�������󡣤ޤ͡�
eeca07d1b1c2 *** empty log message ***
kono
parents: 57
diff changeset
1622
eeca07d1b1c2 *** empty log message ***
kono
parents: 57
diff changeset
1623 Wed Feb 19 20:42:07 JST 2003
eeca07d1b1c2 *** empty log message ***
kono
parents: 57
diff changeset
1624
eeca07d1b1c2 *** empty log message ***
kono
parents: 57
diff changeset
1625 �̤���� C2CbC �� CbC2C ��micro C �˼����ࡣ�ƽ�ˡ�
eeca07d1b1c2 *** empty log message ***
kono
parents: 57
diff changeset
1626 conv->func(); �������ࡣconv �ϡ���¤�Ρ�
eeca07d1b1c2 *** empty log message ***
kono
parents: 57
diff changeset
1627
eeca07d1b1c2 *** empty log message ***
kono
parents: 57
diff changeset
1628 conv: original
eeca07d1b1c2 *** empty log message ***
kono
parents: 57
diff changeset
1629 c2cbc
eeca07d1b1c2 *** empty log message ***
kono
parents: 57
diff changeset
1630 cbc2c
eeca07d1b1c2 *** empty log message ***
kono
parents: 57
diff changeset
1631
eeca07d1b1c2 *** empty log message ***
kono
parents: 57
diff changeset
1632 �Ȥ��롣�ʤ�ۤɡ�