comparison src/pass2.c @ 43:b33eca135258

Added second pass code generation
author lost
date Sun, 04 Jan 2009 06:16:22 +0000
parents 05d4115b4860
children 2330b88f9600
comparison
equal deleted inserted replaced
42:4bb7b723e5b7 43:b33eca135258
1 /* 1 /*
2 pass2.c 2 pass2.c
3 Copyright © 2008 William Astle 3 Copyright © 2009 William Astle
4 4
5 This file is part of LWASM. 5 This file is part of LWASM.
6 6
7 LWASM is free software: you can redistribute it and/or modify it under the 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 8 terms of the GNU General Public License as published by the Free Software
24 24
25 #ifdef HAVE_CONFIG_H 25 #ifdef HAVE_CONFIG_H
26 #include "config.h" 26 #include "config.h"
27 #endif 27 #endif
28 28
29 #include <argp.h>
30 #include <errno.h>
31 #include <stdio.h>
32 #include <stdlib.h>
33
34 #include "lwasm.h" 29 #include "lwasm.h"
35 30
36 void lwasm_pass2(asmstate_t *as) 31 void lwasm_pass2(asmstate_t *as)
37 { 32 {
33 lwasm_line_t *l;
34
35 as -> passnum = 2;
36 as -> addr = 0;
37
38 // iterate over all the lines and re-parse them
39 for (l = as -> lineshead; l; l = l -> next)
40 lwasm_parse_line(as, l);
38 } 41 }