comparison lwasm/instab.c @ 236:a58f49a77441

Added os9 target, pragma to control whether $ localizes a symbol, and fixed some condition nesting bugs
author lost
date Fri, 14 Aug 2009 03:22:26 +0000
parents 4e25aa2af73c
children f9f01a499525
comparison
equal deleted inserted replaced
235:aa0056ca7319 236:a58f49a77441
64 extern OPFUNC(pseudo_ifeq); 64 extern OPFUNC(pseudo_ifeq);
65 extern OPFUNC(pseudo_ifgt); 65 extern OPFUNC(pseudo_ifgt);
66 extern OPFUNC(pseudo_ifge); 66 extern OPFUNC(pseudo_ifge);
67 extern OPFUNC(pseudo_iflt); 67 extern OPFUNC(pseudo_iflt);
68 extern OPFUNC(pseudo_ifle); 68 extern OPFUNC(pseudo_ifle);
69 extern OPFUNC(pseudo_ifp1);
70 extern OPFUNC(pseudo_ifp2);
69 extern OPFUNC(pseudo_else); 71 extern OPFUNC(pseudo_else);
70 extern OPFUNC(pseudo_endc); 72 extern OPFUNC(pseudo_endc);
71 extern OPFUNC(pseudo_macro); 73 extern OPFUNC(pseudo_macro);
72 extern OPFUNC(pseudo_endm); 74 extern OPFUNC(pseudo_endm);
73 extern OPFUNC(pseudo_setdp); 75 extern OPFUNC(pseudo_setdp);
80 extern OPFUNC(pseudo_export); 82 extern OPFUNC(pseudo_export);
81 extern OPFUNC(pseudo_ifdef); 83 extern OPFUNC(pseudo_ifdef);
82 extern OPFUNC(pseudo_ifndef); 84 extern OPFUNC(pseudo_ifndef);
83 extern OPFUNC(pseudo_noop); 85 extern OPFUNC(pseudo_noop);
84 extern OPFUNC(pseudo_includebin); 86 extern OPFUNC(pseudo_includebin);
87
88 extern OPFUNC(pseudo_os9);
89 extern OPFUNC(pseudo_mod);
90 extern OPFUNC(pseudo_emod);
85 91
86 instab_t instab[] = 92 instab_t instab[] =
87 { 93 {
88 { "abx", { 0x3a, -0x1, -0x1, -0x1 }, insn_inh }, 94 { "abx", { 0x3a, -0x1, -0x1, -0x1 }, insn_inh },
89 { "adca", { 0x99, 0xa9, 0xb9, 0x89 }, insn_gen8 }, 95 { "adca", { 0x99, 0xa9, 0xb9, 0x89 }, insn_gen8 },
369 375
370 { "end", { -1, -1, -1, -1 }, pseudo_end }, 376 { "end", { -1, -1, -1, -1 }, pseudo_end },
371 377
372 { "includebin", { -1, -1, -1, -1}, pseudo_includebin }, 378 { "includebin", { -1, -1, -1, -1}, pseudo_includebin },
373 { "include", { -1, -1, -1, -1 }, pseudo_include }, 379 { "include", { -1, -1, -1, -1 }, pseudo_include },
380 { "use", { -1, -1, -1, -1 }, pseudo_include },
374 381
375 { "align", { -1, -1, -1, -1 }, pseudo_align }, 382 { "align", { -1, -1, -1, -1 }, pseudo_align },
376 383
377 { "error", { -1, -1, -1, -1}, pseudo_error }, 384 { "error", { -1, -1, -1, -1}, pseudo_error },
385
386 // these are *dangerous*
387 { "ifp1", { -1, -1, -1, -1}, pseudo_ifp1, 1 },
388 { "ifp2", { -1, -1, -1, -1}, pseudo_ifp2, 1 },
378 389
379 { "ifeq", { -1, -1, -1, -1}, pseudo_ifeq, 1 }, 390 { "ifeq", { -1, -1, -1, -1}, pseudo_ifeq, 1 },
380 { "ifne", { -1, -1, -1, -1}, pseudo_ifne, 1 }, 391 { "ifne", { -1, -1, -1, -1}, pseudo_ifne, 1 },
381 { "if", { -1, -1, -1, -1}, pseudo_ifne, 1 }, 392 { "if", { -1, -1, -1, -1}, pseudo_ifne, 1 },
382 { "ifgt", { -1, -1, -1, -1}, pseudo_ifgt, 1 }, 393 { "ifgt", { -1, -1, -1, -1}, pseudo_ifgt, 1 },
400 { "endsect", { -1, -1, -1, -1}, pseudo_endsection }, 411 { "endsect", { -1, -1, -1, -1}, pseudo_endsection },
401 { "endsection", { -1, -1, -1, -1}, pseudo_endsection }, 412 { "endsection", { -1, -1, -1, -1}, pseudo_endsection },
402 413
403 { "pragma", { -1, -1, -1, -1}, pseudo_pragma }, 414 { "pragma", { -1, -1, -1, -1}, pseudo_pragma },
404 { "*pragma", { -1, -1, -1, -1}, pseudo_starpragma }, 415 { "*pragma", { -1, -1, -1, -1}, pseudo_starpragma },
416
417 // for os9 target
418 { "os9", { -1, -1, -1, -1 }, pseudo_os9 },
419 { "mod", { -1, -1, -1, -1 }, pseudo_mod },
420 { "emod", { -1, -1, -1, -1 }, pseudo_emod },
405 421
406 /* for compatibility with gcc6809 output... */ 422 /* for compatibility with gcc6809 output... */
407 { ".area", { -1, -1, -1, -1}, pseudo_section }, 423 { ".area", { -1, -1, -1, -1}, pseudo_section },
408 { ".globl", { -1, -1, -1, -1}, pseudo_export }, 424 { ".globl", { -1, -1, -1, -1}, pseudo_export },
409 { ".module", { -1, -1, -1, -1}, pseudo_noop }, 425 { ".module", { -1, -1, -1, -1}, pseudo_noop },
433 // needs to handle C escapes maybe? 449 // needs to handle C escapes maybe?
434 // { ".ascii", { -1, -1, -1, -1}, pseudo_ascii }, 450 // { ".ascii", { -1, -1, -1, -1}, pseudo_ascii },
435 451
436 // for compatibility 452 // for compatibility
437 { ".end", { -1, -1, -1, -1 }, pseudo_end }, 453 { ".end", { -1, -1, -1, -1 }, pseudo_end },
454
455 // extra ops that are ignored because they are generally only for
456 // pretty printing the listing
457 { "nam", { -1, -1, -1, -1 }, pseudo_noop },
458 { "pag", { -1, -1, -1, -1 }, pseudo_noop },
459 { "ttl", { -1, -1, -1, -1 }, pseudo_noop },
438 460
439 /* flag end of table */ 461 /* flag end of table */
440 { NULL, { -0x1, -0x1, -0x1, -0x1 }, insn_inh } 462 { NULL, { -0x1, -0x1, -0x1, -0x1 }, insn_inh }
441 }; 463 };