annotate old-trunk/lwasm/lwasm.h @ 354:60568b123281

Added os9 opcodes and ERROR
author lost@starbug
date Tue, 30 Mar 2010 23:10:01 -0600
parents eb230fa7d28e
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
339
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
1 /*
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
2 lwasm.h
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
3 Copyright © 2009 William Astle
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
4
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
5 This file is part of LWASM.
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
6
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
7 LWASM is free software: you can redistribute it and/or modify it under the
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
8 terms of the GNU General Public License as published by the Free Software
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
9 Foundation, either version 3 of the License, or (at your option) any later
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
10 version.
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
11
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
12 This program is distributed in the hope that it will be useful, but WITHOUT
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
15 more details.
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
16
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
17 You should have received a copy of the GNU General Public License along with
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
18 this program. If not, see <http://www.gnu.org/licenses/>.
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
19
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
20 Contains the main defs used by the assembler
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
21 */
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
22
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
23
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
24 #ifndef __lwasm_h_seen__
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
25 #define __lwasm_h_seen__
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
26
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
27 #define OUTPUT_DECB 0 // DECB multirecord format
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
28 #define OUTPUT_RAW 1 // raw sequence of bytes
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
29 #define OUTPUT_OBJ 2 // proprietary object file format
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
30 #define OUTPUT_RAWREL 3 // raw bytes where ORG causes a SEEK in the file
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
31 #define OUTPUT_OS9 4 // os9 module target
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
32
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
33 // keep track of current assembler state
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
34 typedef struct {
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
35 const char *infile; // input file
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
36 const char *outfile; // output file
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
37 const char *listfile; // output listing file
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
38 int outformat; // output format type
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
39 int no6309; // set for 6809-only mode
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
40 int pragmas; // pragmas in effect
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
41 } asmstate_t;
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
42
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
43 // do not rewrite XXX,r to ,r if XXX evaluates to 0
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
44 #define PRAGMA_NOINDEX0TONONE 1
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
45 // any undefined symbols are considered external
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
46 #define PRAGMA_UNDEFEXTERN 2
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
47 // allow C-style escapes in fcc, fcs, and fcn directives
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
48 #define PRAGMA_CESCAPES 4
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
49 // allow "export <undefsym>" to import the symbol
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
50 #define PRAGMA_IMPORTUNDEFEXPORT 8
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
51 // don't have $ as a local symbol
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
52 #define PRAGMA_DOLLARNOTLOCAL 16
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
53
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
54 #ifndef __lwasm_c_seen__
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
55 #define __lwasm_E__ extern
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
56 #else
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
57 #define __lwasm_E__
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
58 #endif
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
59
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
60 __lwasm_E__ int debug_level;
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
61
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
62 #undef __lwasm_E__
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
63
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
64 #endif //__lwasm_h_seen__