Mercurial > hg-old > index.cgi
view src/pass1.c @ 20:610710a7859f
added lwasm_realloc()
author | lost |
---|---|
date | Fri, 02 Jan 2009 00:42:11 +0000 |
parents | 05d4115b4860 |
children | 3c0e5f311c95 |
line wrap: on
line source
/* pass1.c Copyright © 2008 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 first pass of assembly First pass involves the following: 1. read all lines from the main source file, following all "include" directives as appropriate 2. parse each line into a symbol, operation code, and operand as appropriate 3. each operand is evaluated for syntax and futher for value if there are multiple addressing sizes available; any undefined or not fully resolved value will default to the largest addressing size available (16 bit) 4. addresses are assigned to every symbol defined in the assembly 5. macros are defined and expanded at this pass */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include <argp.h> #include <errno.h> #include <stdio.h> #include <stdlib.h> #include "lwasm.h" void lwasm_pass1(asmstate_t *as) { }