comparison lwasm/main.c @ 367:c6d2a1f54e0c

Change processor target variations to pragmas. Add "pragma 6809" and "pragma 6309" which select the processor target rather than a global flag. The command line switches set or reset the pragma appropriately. Thanks to Erik G <erik@6809.org> for the patch.
author William Astle <lost@l-w.ca>
date Mon, 15 Jun 2015 21:21:58 -0600
parents 433dbc18fb41
children 8e25147c2aa8
comparison
equal deleted inserted replaced
366:433dbc18fb41 367:c6d2a1f54e0c
200 exit(1); 200 exit(1);
201 } 201 }
202 break; 202 break;
203 203
204 case '9': 204 case '9':
205 as -> target = TARGET_6809; 205 as -> pragmas |= PRAGMA_6809;
206 break; 206 break;
207 207
208 case '3': 208 case '3':
209 as -> target = TARGET_6309; 209 as -> pragmas &= ~PRAGMA_6809;
210 break; 210 break;
211 211
212 case 'P': 212 case 'P':
213 as -> preprocess = 1; 213 as -> preprocess = 1;
214 break; 214 break;
290 290
291 /* initialize assembler state */ 291 /* initialize assembler state */
292 asmstate.include_list = lw_stringlist_create(); 292 asmstate.include_list = lw_stringlist_create();
293 asmstate.input_files = lw_stringlist_create(); 293 asmstate.input_files = lw_stringlist_create();
294 asmstate.nextcontext = 1; 294 asmstate.nextcontext = 1;
295 asmstate.target = TARGET_6309;
296 asmstate.exprwidth = 16; 295 asmstate.exprwidth = 16;
297 296
298 /* parse command line arguments */ 297 /* parse command line arguments */
299 lw_cmdline_parse(&cmdline_parser, argc, argv, 0, 0, &asmstate); 298 lw_cmdline_parse(&cmdline_parser, argc, argv, 0, 0, &asmstate);
300 299