Mercurial > hg-old > index.cgi
comparison lwasm/pass2.c @ 151:427e268e876b
renamed src to lwasm to better reflect its purpose
author | lost |
---|---|
date | Fri, 30 Jan 2009 04:01:55 +0000 |
parents | src/pass2.c@c8c772ef5df9 |
children | bae1e3ecdce1 |
comparison
equal
deleted
inserted
replaced
150:f0881c115010 | 151:427e268e876b |
---|---|
1 /* | |
2 pass2.c | |
3 Copyright © 2009 William Astle | |
4 | |
5 This file is part of LWASM. | |
6 | |
7 LWASM is free software: you can redistribute it and/or modify it under the | |
8 terms of the GNU General Public License as published by the Free Software | |
9 Foundation, either version 3 of the License, or (at your option) any later | |
10 version. | |
11 | |
12 This program is distributed in the hope that it will be useful, but WITHOUT | |
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | |
15 more details. | |
16 | |
17 You should have received a copy of the GNU General Public License along with | |
18 this program. If not, see <http://www.gnu.org/licenses/>. | |
19 | |
20 | |
21 Handles second pass of assembly | |
22 | |
23 */ | |
24 | |
25 #ifdef HAVE_CONFIG_H | |
26 #include "config.h" | |
27 #endif | |
28 | |
29 #include "lwasm.h" | |
30 | |
31 void lwasm_pass2(asmstate_t *as) | |
32 { | |
33 lwasm_line_t *l; | |
34 sectiontab_t *st; | |
35 | |
36 debug_message(1, "Entering pass 2"); | |
37 as -> passnum = 2; | |
38 as -> addr = 0; | |
39 as -> context = 0; | |
40 as -> endseen = 0; | |
41 as -> skipcond = 0; | |
42 as -> skipcount = 0; | |
43 as -> skipmacro = 0; | |
44 as -> inmacro = 0; | |
45 as -> nextcontext = 1; | |
46 as -> skiplines = 0; | |
47 as -> dpval = 0; | |
48 | |
49 for (st = as -> sections; st; st = st -> next) | |
50 st -> offset = 0; | |
51 as -> csect = NULL; | |
52 | |
53 // iterate over all the lines and re-parse them | |
54 for (l = as -> lineshead; l && !(as -> endseen); l = l -> next) | |
55 { | |
56 if (as -> skiplines) | |
57 as -> skiplines--; | |
58 else | |
59 lwasm_parse_line(as, l); | |
60 } | |
61 } |