comparison lwasm/lwasm.h @ 354:60568b123281

Added os9 opcodes and ERROR
author lost@starbug
date Tue, 30 Mar 2010 23:10:01 -0600
parents faa97115952e
children 7166254491ed
comparison
equal deleted inserted replaced
353:faa97115952e 354:60568b123281
70 PRAGMA_DOLLARNOTLOCAL = 0x0001, // dollar sign does not make a symbol local 70 PRAGMA_DOLLARNOTLOCAL = 0x0001, // dollar sign does not make a symbol local
71 PRAGMA_NOINDEX0TONONE = 0x0002, // do not change implicit 0,R to ,R 71 PRAGMA_NOINDEX0TONONE = 0x0002, // do not change implicit 0,R to ,R
72 PRAGMA_UNDEFEXTERN = 0x0004, // undefined symbols are considered to be external 72 PRAGMA_UNDEFEXTERN = 0x0004, // undefined symbols are considered to be external
73 PRAGMA_CESCAPES = 0x0008, // allow C style escapes in fcc, fcs, fcn, etc. 73 PRAGMA_CESCAPES = 0x0008, // allow C style escapes in fcc, fcs, fcn, etc.
74 PRAGMA_IMPORTUNDEFEXPORT = 0x0010 // imports symbol if undefined upon export 74 PRAGMA_IMPORTUNDEFEXPORT = 0x0010 // imports symbol if undefined upon export
75 };
76
77
78 enum
79 {
80 section_flag_bss = 1, // BSS section
81 section_flag_none = 0 // no flags
82 };
83
84 typedef struct sectiontab_s sectiontab_t;
85 struct sectiontab_s
86 {
87 char *name; // section name
88 int flags; // section flags;
89 lw_expr_t offset; // offset for next instance
90 sectiontab_t *next;
75 }; 91 };
76 92
77 typedef struct lwasm_error_s lwasm_error_t; 93 typedef struct lwasm_error_s lwasm_error_t;
78 struct lwasm_error_s 94 struct lwasm_error_s
79 { 95 {
102 int dpval; // direct page value 118 int dpval; // direct page value
103 lwasm_error_t *err; // list of errors 119 lwasm_error_t *err; // list of errors
104 lwasm_error_t *warn; // list of errors 120 lwasm_error_t *warn; // list of errors
105 line_t *prev; // previous line 121 line_t *prev; // previous line
106 line_t *next; // next line 122 line_t *next; // next line
107 123 int inmod; // inside a module?
124 sectiontab_t *csect; // which section are we in?
108 struct line_expr_s *exprs; // expressions used during parsing 125 struct line_expr_s *exprs; // expressions used during parsing
109 char *lstr; // string passed forward 126 char *lstr; // string passed forward
110 asmstate_t *as; // assembler state data ptr 127 asmstate_t *as; // assembler state data ptr
111 }; 128 };
112 129
137 char *name; // name of macro 154 char *name; // name of macro
138 char **lines; // macro lines 155 char **lines; // macro lines
139 int numlines; // number lines in macro 156 int numlines; // number lines in macro
140 macrotab_t *next; // next macro in list 157 macrotab_t *next; // next macro in list
141 }; 158 };
142
143 enum
144 {
145 section_flag_bss = 1, // BSS section
146 section_flag_none = 0 // no flags
147 };
148
149 typedef struct sectiontab_s sectiontab_t;
150 struct sectiontab_s
151 {
152 char *name; // section name
153 int flags; // section flags;
154 lw_expr_t offset; // offset for next instance
155 sectiontab_t *next;
156 };
157
158 struct asmstate_s 159 struct asmstate_s
159 { 160 {
160 int output_format; // output format 161 int output_format; // output format
161 int target; // assembly target 162 int target; // assembly target
162 int debug_level; // level of debugging requested 163 int debug_level; // level of debugging requested
167 int skipcond; // skipping a condition? 168 int skipcond; // skipping a condition?
168 int skipcount; // depth of "skipping" 169 int skipcount; // depth of "skipping"
169 int skipmacro; // are we skipping in a macro? 170 int skipmacro; // are we skipping in a macro?
170 int endseen; // have we seen an "end" pseudo? 171 int endseen; // have we seen an "end" pseudo?
171 int execaddr; // address from "end" 172 int execaddr; // address from "end"
173 int inmod; // inside an os9 module?
174 unsigned char crc[3]; // crc accumulator
172 175
173 line_t *line_head; // start of lines list 176 line_t *line_head; // start of lines list
174 line_t *line_tail; // tail of lines list 177 line_t *line_tail; // tail of lines list
175 178
176 line_t *cl; // current line pointer 179 line_t *cl; // current line pointer