Mercurial > hg-old > index.cgi
comparison src/lwasm.h @ 75:92eb93bffa28
Rejigged symbol system to be able to handle non-constant references
author | lost |
---|---|
date | Thu, 08 Jan 2009 01:32:49 +0000 |
parents | c8c772ef5df9 |
children | 2fe5fd7d65a3 |
comparison
equal
deleted
inserted
replaced
74:c8c772ef5df9 | 75:92eb93bffa28 |
---|---|
83 | 83 |
84 // the following are used for obj format - for external references, inter-section | 84 // the following are used for obj format - for external references, inter-section |
85 // references, and intrasection relocations | 85 // references, and intrasection relocations |
86 int relocoff; // offset into insn where relocation value goes | 86 int relocoff; // offset into insn where relocation value goes |
87 // the incomplete reference expression | 87 // the incomplete reference expression |
88 struct lwasm_expr_strack_t *expr; | 88 lwasm_expr_stack_t *expr; |
89 }; | 89 }; |
90 | 90 |
91 // for keeping track of symbols | 91 // for keeping track of symbols |
92 #define SYMBOL_SET 1 // the symbol was used for "SET" | 92 #define SYMBOL_SET 1 // the symbol was used for "SET" |
93 #define SYMBOL_NORM 0 // no flags | 93 #define SYMBOL_COMPLEX 2 // register symbol as a complex symbol (from l -> expr) |
94 #define SYMBOL_NORM 0 // no flags | |
94 typedef struct lwasm_symbol_ent_s lwasm_symbol_ent_t; | 95 typedef struct lwasm_symbol_ent_s lwasm_symbol_ent_t; |
95 struct lwasm_symbol_ent_s | 96 struct lwasm_symbol_ent_s |
96 { | 97 { |
97 char *sym; // the symbol | 98 char *sym; // the symbol |
98 int context; // the context number of the symbol (-1 for global) | 99 int context; // the context number of the symbol (-1 for global) |
99 int value; // the value of the symbol | 100 int value; // the value of the symbol |
100 int flags; // flags for the symbol | 101 int flags; // flags for the symbol |
102 sectiontab_t *sect; // the section the symbol exists in; NULL for none | |
103 lwasm_expr_stack_t *expr; // expression for a symbol that is not constant NULL for const | |
101 lwasm_symbol_ent_t *next; // next symbol in the table | 104 lwasm_symbol_ent_t *next; // next symbol in the table |
102 lwasm_symbol_ent_t *prev; // previous symbol in the table | 105 lwasm_symbol_ent_t *prev; // previous symbol in the table |
103 }; | 106 }; |
104 | 107 |
105 // keep track of current assembler state | 108 // keep track of current assembler state |