view src/lwasm.h @ 24:98dcaa0dc396

Removed unneeded files from build and distribution
author lost
date Fri, 02 Jan 2009 01:33:07 +0000
parents 3c0e5f311c95
children d2e86babd958
line wrap: on
line source

/*
lwasm.h
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/>.

Contains the main defs used by the assembler
*/


#ifndef __lwasm_h_seen__
#define __lwasm_h_seen__

#define OUTPUT_DECB		0	// DECB multirecord format
#define OUTPUT_RAW		1	// raw sequence of bytes
#define OUTPUT_OBJ		2	// proprietary object file format

// structure for keeping track of lines
typedef struct lwasm_line_s lwasm_line_t;
struct lwasm_line_s {
	char *text;			// the actual text of the line
	int lineno;			// line number within the file
	char *filename;		// file name reference
	lwasm_line_t *next;	// next line
	lwasm_line_t *prev;	// previous line
};

// keep track of current assembler state
typedef struct {
	int dpval;					// current dp value (setdp)
	int addr;					// current address
	int errorcount;				// error count
	int passnum;				// which pass are we on?
	int execaddr;				// execution address for the program (END ....)
	int pragmas;				// what pragmas are in effect?

	lwasm_line_t *lineshead;	// first line of source code
	lwasm_line_t *linestail;	// last line of source code

	const char *infile;			// input file
	const char *outfile;		// output file
	const char *listfile;		// output listing file
	int debug;					// debug mode
	int outformat;				// output format type
	char **filelist;			// files that have been read
	int filelistlen;			// number of files in the list
} asmstate_t;

#define PRAGMA_NOINDEX0TONONE	1

#ifndef __symtab_c_seen__
//extern void register_symbol(asmstate_t *as, sourceline_t *cl, char *symstr, int val, int flags);
//extern int lookup_symbol(asmstate_t *as, char *symstr);
//extern void list_symbols(asmstate_t *as, FILE *f);
#endif


#endif //__lwasm_h_seen__