Mercurial > hg-old > index.cgi
comparison lwasm/lwasm.h @ 389:fbb7bfed8076
Added in structure support and fixed up some warts in the listing code (by adding more warts)
author | lost@l-w.ca |
---|---|
date | Wed, 14 Jul 2010 22:33:55 -0600 |
parents | a741d2e4869f |
children | 027d7fbcdcfc |
comparison
equal
deleted
inserted
replaced
388:8991eb507d2d | 389:fbb7bfed8076 |
---|---|
164 int pragmas; // pragmas in effect for the line | 164 int pragmas; // pragmas in effect for the line |
165 int context; // the symbol context number | 165 int context; // the symbol context number |
166 char *ltext; // line number | 166 char *ltext; // line number |
167 char *linespec; // line spec | 167 char *linespec; // line spec |
168 int lineno; // line number | 168 int lineno; // line number |
169 int soff; // struct offset (for listings) | |
170 int dshow; // data value to show (for listings) | |
171 int dsize; // set to 1 for 8 bit dshow value | |
172 struct symtabe *dptr; // symbol value to display | |
169 }; | 173 }; |
170 | 174 |
171 enum | 175 enum |
172 { | 176 { |
173 symbol_flag_set = 1, // symbol was used with "set" | 177 symbol_flag_set = 1, // symbol was used with "set" |
178 symbol_flag_nocheck = 2, // do not check symbol characters | |
174 symbol_flag_none = 0 // no flags | 179 symbol_flag_none = 0 // no flags |
175 }; | 180 }; |
176 | 181 |
177 struct symtabe | 182 struct symtabe |
178 { | 183 { |
196 char *name; // name of macro | 201 char *name; // name of macro |
197 char **lines; // macro lines | 202 char **lines; // macro lines |
198 int numlines; // number lines in macro | 203 int numlines; // number lines in macro |
199 macrotab_t *next; // next macro in list | 204 macrotab_t *next; // next macro in list |
200 }; | 205 }; |
206 | |
207 typedef struct structtab_s structtab_t; | |
208 typedef struct structtab_field_s structtab_field_t; | |
209 | |
210 struct structtab_field_s | |
211 { | |
212 char *name; // structure field name - NULL for anonymous | |
213 int size; // structure field size | |
214 structtab_t *substruct; // sub structure if there is one | |
215 structtab_field_t *next; // next field entry | |
216 }; | |
217 | |
218 struct structtab_s | |
219 { | |
220 char *name; // name of structure | |
221 int size; // number of bytes taken by struct | |
222 structtab_field_t *fields; // fields in the structure | |
223 structtab_t *next; // next structure | |
224 }; | |
225 | |
201 struct asmstate_s | 226 struct asmstate_s |
202 { | 227 { |
203 int output_format; // output format | 228 int output_format; // output format |
204 int target; // assembly target | 229 int target; // assembly target |
205 int debug_level; // level of debugging requested | 230 int debug_level; // level of debugging requested |
206 FILE *debug_file; // FILE * to output debug messages to | 231 FILE *debug_file; // FILE * to output debug messages to |
207 int flags; // assembly flags | 232 int flags; // assembly flags |
208 int pragmas; // pragmas currently in effect | 233 int pragmas; // pragmas currently in effect |
209 int errorcount; // number of errors encountered | 234 int errorcount; // number of errors encountered |
210 int inmacro; // are we in a macro? | 235 int inmacro; // are we in a macro? |
236 int instruct; // are w in a structure? | |
211 int skipcond; // skipping a condition? | 237 int skipcond; // skipping a condition? |
212 int skipcount; // depth of "skipping" | 238 int skipcount; // depth of "skipping" |
213 int skipmacro; // are we skipping in a macro? | 239 int skipmacro; // are we skipping in a macro? |
214 int endseen; // have we seen an "end" pseudo? | 240 int endseen; // have we seen an "end" pseudo? |
215 int execaddr; // address from "end" | 241 int execaddr; // address from "end" |
237 lw_stringlist_t input_files; // files to assemble | 263 lw_stringlist_t input_files; // files to assemble |
238 void *input_data; // opaque data used by the input system | 264 void *input_data; // opaque data used by the input system |
239 lw_stringlist_t include_list; // include paths | 265 lw_stringlist_t include_list; // include paths |
240 lw_stack_t file_dir; // stack of the "current file" dir | 266 lw_stack_t file_dir; // stack of the "current file" dir |
241 lw_stack_t includelist; | 267 lw_stack_t includelist; |
268 | |
269 structtab_t *structs; // defined structures | |
270 structtab_t *cstruct; // current structure | |
242 | 271 |
243 int exportcheck; // set if we need to collapse out the section base to 0 | 272 int exportcheck; // set if we need to collapse out the section base to 0 |
244 }; | 273 }; |
245 | 274 |
246 #ifndef ___symbol_c_seen___ | 275 #ifndef ___symbol_c_seen___ |