diff src/lwasm.h @ 21:3c0e5f311c95

Added reading of input file for pass1
author lost
date Fri, 02 Jan 2009 00:43:06 +0000
parents 05d4115b4860
children d2e86babd958
line wrap: on
line diff
--- a/src/lwasm.h	Fri Jan 02 00:42:11 2009 +0000
+++ b/src/lwasm.h	Fri Jan 02 00:43:06 2009 +0000
@@ -26,8 +26,17 @@
 
 #define OUTPUT_DECB		0	// DECB multirecord format
 #define OUTPUT_RAW		1	// raw sequence of bytes
-#define OUTPUT_RAWREL	2	// raw but with ORG as a relative offset
-#define OUTPUT_OBJ		3	// proprietary object file format
+#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 {
@@ -35,13 +44,19 @@
 	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
-	int execaddr;				// execution address for the program (END ....)
-	int pragmas;				// what pragmas are in effect?
+	char **filelist;			// files that have been read
+	int filelistlen;			// number of files in the list
 } asmstate_t;
 
 #define PRAGMA_NOINDEX0TONONE	1