annotate lwasm/pass3.c @ 364:0b5a26bedbe1

Pass framework simplified; skeleton pass 3
author lost@starbug
date Tue, 06 Apr 2010 21:35:09 -0600
parents
children 6a98cc90c14f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
364
0b5a26bedbe1 Pass framework simplified; skeleton pass 3
lost@starbug
parents:
diff changeset
1 /*
0b5a26bedbe1 Pass framework simplified; skeleton pass 3
lost@starbug
parents:
diff changeset
2 pass3.c
0b5a26bedbe1 Pass framework simplified; skeleton pass 3
lost@starbug
parents:
diff changeset
3
0b5a26bedbe1 Pass framework simplified; skeleton pass 3
lost@starbug
parents:
diff changeset
4 Copyright © 2010 William Astle
0b5a26bedbe1 Pass framework simplified; skeleton pass 3
lost@starbug
parents:
diff changeset
5
0b5a26bedbe1 Pass framework simplified; skeleton pass 3
lost@starbug
parents:
diff changeset
6 This file is part of LWTOOLS.
0b5a26bedbe1 Pass framework simplified; skeleton pass 3
lost@starbug
parents:
diff changeset
7
0b5a26bedbe1 Pass framework simplified; skeleton pass 3
lost@starbug
parents:
diff changeset
8 LWTOOLS is free software: you can redistribute it and/or modify it under the
0b5a26bedbe1 Pass framework simplified; skeleton pass 3
lost@starbug
parents:
diff changeset
9 terms of the GNU General Public License as published by the Free Software
0b5a26bedbe1 Pass framework simplified; skeleton pass 3
lost@starbug
parents:
diff changeset
10 Foundation, either version 3 of the License, or (at your option) any later
0b5a26bedbe1 Pass framework simplified; skeleton pass 3
lost@starbug
parents:
diff changeset
11 version.
0b5a26bedbe1 Pass framework simplified; skeleton pass 3
lost@starbug
parents:
diff changeset
12
0b5a26bedbe1 Pass framework simplified; skeleton pass 3
lost@starbug
parents:
diff changeset
13 This program is distributed in the hope that it will be useful, but WITHOUT
0b5a26bedbe1 Pass framework simplified; skeleton pass 3
lost@starbug
parents:
diff changeset
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0b5a26bedbe1 Pass framework simplified; skeleton pass 3
lost@starbug
parents:
diff changeset
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
0b5a26bedbe1 Pass framework simplified; skeleton pass 3
lost@starbug
parents:
diff changeset
16 more details.
0b5a26bedbe1 Pass framework simplified; skeleton pass 3
lost@starbug
parents:
diff changeset
17
0b5a26bedbe1 Pass framework simplified; skeleton pass 3
lost@starbug
parents:
diff changeset
18 You should have received a copy of the GNU General Public License along with
0b5a26bedbe1 Pass framework simplified; skeleton pass 3
lost@starbug
parents:
diff changeset
19 this program. If not, see <http://www.gnu.org/licenses/>.
0b5a26bedbe1 Pass framework simplified; skeleton pass 3
lost@starbug
parents:
diff changeset
20 */
0b5a26bedbe1 Pass framework simplified; skeleton pass 3
lost@starbug
parents:
diff changeset
21
0b5a26bedbe1 Pass framework simplified; skeleton pass 3
lost@starbug
parents:
diff changeset
22 #include <config.h>
0b5a26bedbe1 Pass framework simplified; skeleton pass 3
lost@starbug
parents:
diff changeset
23
0b5a26bedbe1 Pass framework simplified; skeleton pass 3
lost@starbug
parents:
diff changeset
24 #include <stdio.h>
0b5a26bedbe1 Pass framework simplified; skeleton pass 3
lost@starbug
parents:
diff changeset
25 #include <string.h>
0b5a26bedbe1 Pass framework simplified; skeleton pass 3
lost@starbug
parents:
diff changeset
26
0b5a26bedbe1 Pass framework simplified; skeleton pass 3
lost@starbug
parents:
diff changeset
27 #include <lw_alloc.h>
0b5a26bedbe1 Pass framework simplified; skeleton pass 3
lost@starbug
parents:
diff changeset
28 #include <lw_string.h>
0b5a26bedbe1 Pass framework simplified; skeleton pass 3
lost@starbug
parents:
diff changeset
29
0b5a26bedbe1 Pass framework simplified; skeleton pass 3
lost@starbug
parents:
diff changeset
30 #include "lwasm.h"
0b5a26bedbe1 Pass framework simplified; skeleton pass 3
lost@starbug
parents:
diff changeset
31 #include "instab.h"
0b5a26bedbe1 Pass framework simplified; skeleton pass 3
lost@starbug
parents:
diff changeset
32
0b5a26bedbe1 Pass framework simplified; skeleton pass 3
lost@starbug
parents:
diff changeset
33 /*
0b5a26bedbe1 Pass framework simplified; skeleton pass 3
lost@starbug
parents:
diff changeset
34 Resolve1 Pass
0b5a26bedbe1 Pass framework simplified; skeleton pass 3
lost@starbug
parents:
diff changeset
35
0b5a26bedbe1 Pass framework simplified; skeleton pass 3
lost@starbug
parents:
diff changeset
36 repeatedly resolve instruction sizes and line addresses
0b5a26bedbe1 Pass framework simplified; skeleton pass 3
lost@starbug
parents:
diff changeset
37 until nothing more reduces
0b5a26bedbe1 Pass framework simplified; skeleton pass 3
lost@starbug
parents:
diff changeset
38
0b5a26bedbe1 Pass framework simplified; skeleton pass 3
lost@starbug
parents:
diff changeset
39 */
0b5a26bedbe1 Pass framework simplified; skeleton pass 3
lost@starbug
parents:
diff changeset
40 void do_pass3(asmstate_t *as)
0b5a26bedbe1 Pass framework simplified; skeleton pass 3
lost@starbug
parents:
diff changeset
41 {
0b5a26bedbe1 Pass framework simplified; skeleton pass 3
lost@starbug
parents:
diff changeset
42 }