Mercurial > hg-old > index.cgi
comparison lwasm/lwasm.h @ 236:a58f49a77441
Added os9 target, pragma to control whether $ localizes a symbol, and fixed some condition nesting bugs
author | lost |
---|---|
date | Fri, 14 Aug 2009 03:22:26 +0000 |
parents | 0df2a39a268c |
children | a9a14e6b4bc8 |
comparison
equal
deleted
inserted
replaced
235:aa0056ca7319 | 236:a58f49a77441 |
---|---|
29 | 29 |
30 #define OUTPUT_DECB 0 // DECB multirecord format | 30 #define OUTPUT_DECB 0 // DECB multirecord format |
31 #define OUTPUT_RAW 1 // raw sequence of bytes | 31 #define OUTPUT_RAW 1 // raw sequence of bytes |
32 #define OUTPUT_OBJ 2 // proprietary object file format | 32 #define OUTPUT_OBJ 2 // proprietary object file format |
33 #define OUTPUT_RAWREL 3 // raw bytes where ORG causes a SEEK in the file | 33 #define OUTPUT_RAWREL 3 // raw bytes where ORG causes a SEEK in the file |
34 #define OUTPUT_OS9 4 // os9 module target | |
34 | 35 |
35 // structure for tracking sections | 36 // structure for tracking sections |
36 typedef struct section_reloc_list_s section_reloc_list_t; | 37 typedef struct section_reloc_list_s section_reloc_list_t; |
37 struct section_reloc_list_s | 38 struct section_reloc_list_s |
38 { | 39 { |
116 int relocoff; // offset into insn where relocation value goes | 117 int relocoff; // offset into insn where relocation value goes |
117 int reloc8bit; // size of relocation (0 = 16 bit, 1 = 8 bit) | 118 int reloc8bit; // size of relocation (0 = 16 bit, 1 = 8 bit) |
118 lwasm_expr_stack_t *exprs[4]; // non-constant expression values | 119 lwasm_expr_stack_t *exprs[4]; // non-constant expression values |
119 int exprvals[4]; // constant expression values | 120 int exprvals[4]; // constant expression values |
120 char *exprends[4]; // pointer to character after end of expression | 121 char *exprends[4]; // pointer to character after end of expression |
122 int inmod; // in an os9 module | |
121 | 123 |
122 sectiontab_t *sect; // which section is the line in? | 124 sectiontab_t *sect; // which section is the line in? |
123 }; | 125 }; |
124 | 126 |
125 // for keeping track of symbols | 127 // for keeping track of symbols |
180 // items used only for the "object" target | 182 // items used only for the "object" target |
181 sectiontab_t *sections; // pointer to section table | 183 sectiontab_t *sections; // pointer to section table |
182 sectiontab_t *csect; // current section - NULL if not in one | 184 sectiontab_t *csect; // current section - NULL if not in one |
183 | 185 |
184 // only 6809 ops? | 186 // only 6809 ops? |
185 int no6309; | 187 int no6309; |
188 | |
189 // for os9 mode | |
190 int inmod; // in a module? | |
191 unsigned long crc; // running crc count | |
186 } asmstate_t; | 192 } asmstate_t; |
187 | 193 |
188 // do not rewrite XXX,r to ,r if XXX evaluates to 0 | 194 // do not rewrite XXX,r to ,r if XXX evaluates to 0 |
189 #define PRAGMA_NOINDEX0TONONE 1 | 195 #define PRAGMA_NOINDEX0TONONE 1 |
190 // any undefined symbols are considered external | 196 // any undefined symbols are considered external |
191 #define PRAGMA_UNDEFEXTERN 2 | 197 #define PRAGMA_UNDEFEXTERN 2 |
192 // allow C-style escapes in fcc, fcs, and fcn directives | 198 // allow C-style escapes in fcc, fcs, and fcn directives |
193 #define PRAGMA_CESCAPES 4 | 199 #define PRAGMA_CESCAPES 4 |
194 | |
195 // allow "export <undefsym>" to import the symbol | 200 // allow "export <undefsym>" to import the symbol |
196 #define PRAGMA_IMPORTUNDEFEXPORT 8 | 201 #define PRAGMA_IMPORTUNDEFEXPORT 8 |
202 // don't have $ as a local symbol | |
203 #define PRAGMA_DOLLARNOTLOCAL 16 | |
197 | 204 |
198 #ifndef __lwasm_c_seen__ | 205 #ifndef __lwasm_c_seen__ |
199 #define __lwasm_E__ extern | 206 #define __lwasm_E__ extern |
200 #else | 207 #else |
201 #define __lwasm_E__ | 208 #define __lwasm_E__ |