view 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
line wrap: on
line source

/*
pass2.c
Copyright © 2009 William Astle

This file is part of LWASM.

LWASM is free software: you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation, either version 3 of the License, or (at your option) any later
version.

This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details.

You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.


Handles second pass of assembly

*/

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include "lwasm.h"

void lwasm_pass2(asmstate_t *as)
{
	lwasm_line_t *l;

	as -> passnum = 2;
	as -> addr = 0;
	
	// iterate over all the lines and re-parse them
	for (l = as -> lineshead; l; l = l -> next)
		lwasm_parse_line(as, l);
}