annotate lwasm/pass7.c @ 413:b30a77f0b685

Fixed endc to actually match properly
author lost@l-w.ca
date Mon, 09 Aug 2010 20:57:02 -0600
parents 656630007668
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
368
656630007668 Emit pass
lost@starbug
parents:
diff changeset
1 /*
656630007668 Emit pass
lost@starbug
parents:
diff changeset
2 pass7.c
656630007668 Emit pass
lost@starbug
parents:
diff changeset
3
656630007668 Emit pass
lost@starbug
parents:
diff changeset
4 Copyright © 2010 William Astle
656630007668 Emit pass
lost@starbug
parents:
diff changeset
5
656630007668 Emit pass
lost@starbug
parents:
diff changeset
6 This file is part of LWTOOLS.
656630007668 Emit pass
lost@starbug
parents:
diff changeset
7
656630007668 Emit pass
lost@starbug
parents:
diff changeset
8 LWTOOLS is free software: you can redistribute it and/or modify it under the
656630007668 Emit pass
lost@starbug
parents:
diff changeset
9 terms of the GNU General Public License as published by the Free Software
656630007668 Emit pass
lost@starbug
parents:
diff changeset
10 Foundation, either version 3 of the License, or (at your option) any later
656630007668 Emit pass
lost@starbug
parents:
diff changeset
11 version.
656630007668 Emit pass
lost@starbug
parents:
diff changeset
12
656630007668 Emit pass
lost@starbug
parents:
diff changeset
13 This program is distributed in the hope that it will be useful, but WITHOUT
656630007668 Emit pass
lost@starbug
parents:
diff changeset
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
656630007668 Emit pass
lost@starbug
parents:
diff changeset
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
656630007668 Emit pass
lost@starbug
parents:
diff changeset
16 more details.
656630007668 Emit pass
lost@starbug
parents:
diff changeset
17
656630007668 Emit pass
lost@starbug
parents:
diff changeset
18 You should have received a copy of the GNU General Public License along with
656630007668 Emit pass
lost@starbug
parents:
diff changeset
19 this program. If not, see <http://www.gnu.org/licenses/>.
656630007668 Emit pass
lost@starbug
parents:
diff changeset
20 */
656630007668 Emit pass
lost@starbug
parents:
diff changeset
21
656630007668 Emit pass
lost@starbug
parents:
diff changeset
22 #include <config.h>
656630007668 Emit pass
lost@starbug
parents:
diff changeset
23
656630007668 Emit pass
lost@starbug
parents:
diff changeset
24 #include <stdio.h>
656630007668 Emit pass
lost@starbug
parents:
diff changeset
25 #include <string.h>
656630007668 Emit pass
lost@starbug
parents:
diff changeset
26
656630007668 Emit pass
lost@starbug
parents:
diff changeset
27 #include <lw_alloc.h>
656630007668 Emit pass
lost@starbug
parents:
diff changeset
28 #include <lw_string.h>
656630007668 Emit pass
lost@starbug
parents:
diff changeset
29
656630007668 Emit pass
lost@starbug
parents:
diff changeset
30 #include "lwasm.h"
656630007668 Emit pass
lost@starbug
parents:
diff changeset
31 #include "instab.h"
656630007668 Emit pass
lost@starbug
parents:
diff changeset
32
656630007668 Emit pass
lost@starbug
parents:
diff changeset
33 /*
656630007668 Emit pass
lost@starbug
parents:
diff changeset
34 emit pass
656630007668 Emit pass
lost@starbug
parents:
diff changeset
35
656630007668 Emit pass
lost@starbug
parents:
diff changeset
36 Generate object code
656630007668 Emit pass
lost@starbug
parents:
diff changeset
37 */
656630007668 Emit pass
lost@starbug
parents:
diff changeset
38 void do_pass7(asmstate_t *as)
656630007668 Emit pass
lost@starbug
parents:
diff changeset
39 {
656630007668 Emit pass
lost@starbug
parents:
diff changeset
40 line_t *cl;
656630007668 Emit pass
lost@starbug
parents:
diff changeset
41
656630007668 Emit pass
lost@starbug
parents:
diff changeset
42 for (cl = as -> line_head; cl; cl = cl -> next)
656630007668 Emit pass
lost@starbug
parents:
diff changeset
43 {
656630007668 Emit pass
lost@starbug
parents:
diff changeset
44 as -> cl = cl;
656630007668 Emit pass
lost@starbug
parents:
diff changeset
45 if (cl -> insn != -1)
656630007668 Emit pass
lost@starbug
parents:
diff changeset
46 {
656630007668 Emit pass
lost@starbug
parents:
diff changeset
47 if (instab[cl -> insn].emit)
656630007668 Emit pass
lost@starbug
parents:
diff changeset
48 {
656630007668 Emit pass
lost@starbug
parents:
diff changeset
49 (instab[cl -> insn].emit)(as, cl);
656630007668 Emit pass
lost@starbug
parents:
diff changeset
50 }
656630007668 Emit pass
lost@starbug
parents:
diff changeset
51 }
656630007668 Emit pass
lost@starbug
parents:
diff changeset
52 }
656630007668 Emit pass
lost@starbug
parents:
diff changeset
53 }