Mercurial > hg-old > index.cgi
annotate lwasm/instab.h @ 381:1624a36f12a3
Properly support 32 bit relocations
author | lost@starbug |
---|---|
date | Mon, 26 Apr 2010 19:56:10 -0600 |
parents | 7d91ab7ac7d6 |
children | fbb7bfed8076 |
rev | line source |
---|---|
337 | 1 /* |
2 instab.h | |
3 Copyright © 2008 William Astle | |
4 | |
5 This file is part of LWASM. | |
6 | |
7 LWASM is free software: you can redistribute it and/or modify it under the | |
8 terms of the GNU General Public License as published by the Free Software | |
9 Foundation, either version 3 of the License, or (at your option) any later | |
10 version. | |
11 | |
12 This program is distributed in the hope that it will be useful, but WITHOUT | |
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | |
15 more details. | |
16 | |
17 You should have received a copy of the GNU General Public License along with | |
18 this program. If not, see <http://www.gnu.org/licenses/>. | |
19 | |
20 | |
21 Contains definitions for the instruction table | |
22 */ | |
23 | |
24 #ifndef __instab_h_seen__ | |
25 #define __instab_h_seen__ | |
26 | |
27 #include "lwasm.h" | |
28 | |
29 typedef struct | |
30 { | |
31 char *opcode; /* the mneumonic */ | |
32 int ops[4]; /* opcode values for up to four addr modes */ | |
33 void (*parse)(asmstate_t *as, line_t *l, char **optr); /* parse operand for insn */ | |
360
7d91ab7ac7d6
Indexed stage 2; set line structure to track pragmas in effect for that line
lost@starbug
parents:
348
diff
changeset
|
34 void (*resolve)(asmstate_t *as, line_t *l, int force); /* resolve instruction to code */ |
348
11a95c6414b4
Added third func to instab to split resolve and emit logic
lost@starbug
parents:
337
diff
changeset
|
35 void (*emit)(asmstate_t *as, line_t *l); /* resolve instruction to code */ |
337 | 36 int flags; /* flag for this instruction */ |
37 } instab_t; | |
38 | |
39 enum | |
40 { | |
41 lwasm_insn_normal = 0, | |
42 lwasm_insn_cond = 1, /* conditional instruction */ | |
43 lwasm_insn_endm = 2, /* end of macro */ | |
44 lwasm_insn_setsym = 4, /* insn sets symbol address */ | |
45 lwasm_insn_is6309 = 8 /* insn is 6309 only */ | |
46 }; | |
47 | |
48 | |
49 #define PARSEFUNC(fn) void (fn)(asmstate_t *as, line_t *l, char **p) | |
360
7d91ab7ac7d6
Indexed stage 2; set line structure to track pragmas in effect for that line
lost@starbug
parents:
348
diff
changeset
|
50 #define RESOLVEFUNC(fn) void (fn)(asmstate_t *as, line_t *l, int force) |
348
11a95c6414b4
Added third func to instab to split resolve and emit logic
lost@starbug
parents:
337
diff
changeset
|
51 #define EMITFUNC(fn) void (fn)(asmstate_t *as, line_t *l) |
337 | 52 |
53 #ifndef __instab_c_seen__ | |
54 extern instab_t instab[]; | |
55 #endif //__instab_c_seen__ | |
56 | |
57 #endif //__instab_h_seen__ |