diff src/lwasm.h @ 74:c8c772ef5df9

Checkpointing object target implementation
author lost
date Thu, 08 Jan 2009 01:18:40 +0000
parents d5fe306f1ab1
children 92eb93bffa28
line wrap: on
line diff
--- a/src/lwasm.h	Thu Jan 08 01:18:09 2009 +0000
+++ b/src/lwasm.h	Thu Jan 08 01:18:40 2009 +0000
@@ -32,6 +32,17 @@
 #define OUTPUT_OBJ		2	// proprietary object file format
 #define OUTPUT_RAWREL	3	// raw bytes where ORG causes a SEEK in the file
 
+// structure for tracking sections
+#define SECTION_BSS		1	// the section contains no actual code - just uninit vars
+typedef struct sectiontab_s sectiontab_t;
+struct sectiontab_s
+{
+	char *name;				// name of the section
+	int offset;				// current offset in the section
+	int flags;				// section flags
+	sectiontab_t *next;		// next section
+};
+
 // structure for tracking macros
 typedef struct macrotab_s macrotab_t;
 struct macrotab_s
@@ -69,6 +80,12 @@
 	int addrset;		// set if this instruction sets the assembly address
 	int symaddr;		// set if this instruction sets a symbol addr with EQU or the like
 	int badop;			// bad operation - ignore it
+	
+	// the following are used for obj format - for external references, inter-section
+	// references, and intrasection relocations
+	int relocoff;		// offset into insn where relocation value goes
+	// the incomplete reference expression
+	struct lwasm_expr_strack_t *expr;
 };
 
 // for keeping track of symbols
@@ -118,6 +135,10 @@
 	int macroex;				// current depth of macro expansion
 	int nextcontext;			// next context number
 	int skiplines;				// number of lines to skip
+	
+	// items used only for the "object" target
+	sectiontab_t *sections;		// pointer to section table
+	sectiontab_t *csect;		// current section - NULL if not in one
 } asmstate_t;
 
 #define PRAGMA_NOINDEX0TONONE	1