Mercurial > hg-old > index.cgi
diff 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 |
line wrap: on
line diff
--- a/lwasm/lwasm.h Wed Jul 14 20:17:57 2010 -0600 +++ b/lwasm/lwasm.h Wed Jul 14 22:33:55 2010 -0600 @@ -166,11 +166,16 @@ char *ltext; // line number char *linespec; // line spec int lineno; // line number + int soff; // struct offset (for listings) + int dshow; // data value to show (for listings) + int dsize; // set to 1 for 8 bit dshow value + struct symtabe *dptr; // symbol value to display }; enum { symbol_flag_set = 1, // symbol was used with "set" + symbol_flag_nocheck = 2, // do not check symbol characters symbol_flag_none = 0 // no flags }; @@ -198,6 +203,26 @@ int numlines; // number lines in macro macrotab_t *next; // next macro in list }; + +typedef struct structtab_s structtab_t; +typedef struct structtab_field_s structtab_field_t; + +struct structtab_field_s +{ + char *name; // structure field name - NULL for anonymous + int size; // structure field size + structtab_t *substruct; // sub structure if there is one + structtab_field_t *next; // next field entry +}; + +struct structtab_s +{ + char *name; // name of structure + int size; // number of bytes taken by struct + structtab_field_t *fields; // fields in the structure + structtab_t *next; // next structure +}; + struct asmstate_s { int output_format; // output format @@ -208,6 +233,7 @@ int pragmas; // pragmas currently in effect int errorcount; // number of errors encountered int inmacro; // are we in a macro? + int instruct; // are w in a structure? int skipcond; // skipping a condition? int skipcount; // depth of "skipping" int skipmacro; // are we skipping in a macro? @@ -239,6 +265,9 @@ lw_stringlist_t include_list; // include paths lw_stack_t file_dir; // stack of the "current file" dir lw_stack_t includelist; + + structtab_t *structs; // defined structures + structtab_t *cstruct; // current structure int exportcheck; // set if we need to collapse out the section base to 0 };