annotate lwasm/insn_gen.c @ 444:cf0324651d8f default

Added tag 3.0.1 for changeset 8f9d72cfb897
author lost@l-w.ca
date Sat, 30 Oct 2010 15:21:27 -0600
parents 4867f18c872f
children eacdae8a1575
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 insn_gen.c, Copyright © 2009 William Astle
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
3
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
4 This file is part of LWASM.
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
5
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
6 LWASM is free software: you can redistribute it and/or modify it under the
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
7 terms of the GNU General Public License as published by the Free Software
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
8 Foundation, either version 3 of the License, or (at your option) any later
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
9 version.
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
10
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
11 This program is distributed in the hope that it will be useful, but WITHOUT
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
14 more details.
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
15
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
16 You should have received a copy of the GNU General Public License along with
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
17 this program. If not, see <http://www.gnu.org/licenses/>.
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
18
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
19 Contains code for parsing general addressing modes (IMM+DIR+EXT+IND)
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
20 */
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
21
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
22 #include <config.h>
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
23
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
24 #include <ctype.h>
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
25 #include <stdlib.h>
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
26
361
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
27 #include <lw_expr.h>
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
28
339
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
29 #include "lwasm.h"
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
30 #include "instab.h"
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
31
361
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
32 extern void insn_indexed_parse_aux(asmstate_t *as, line_t *l, char **p);
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
33 extern void insn_indexed_resolve_aux(asmstate_t *as, line_t *l, int force);
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
34 extern void insn_indexed_emit_aux(asmstate_t *as, line_t *l);
339
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
35
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
36 // "extra" is required due to the way OIM, EIM, TIM, and AIM work
361
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
37 void insn_parse_gen_aux(asmstate_t *as, line_t *l, char **p)
339
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
38 {
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
39 const char *optr2;
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
40 int v1, tv, rval;
361
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
41 lw_expr_t *s;
339
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
42
361
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
43 optr2 = *p;
339
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
44 while (*optr2 && !isspace(*optr2) && *optr2 != ',') optr2++
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
45 /* do nothing */ ;
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
46
361
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
47 if (*optr2 == ',' || **p == '[')
339
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
48 {
361
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
49 l -> lint = -1;
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
50 l -> lint2 = 1;
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
51 insn_parse_indexed_aux(as, l, p);
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
52 goto out;
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
53 }
339
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
54
361
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
55 if (**p == '<')
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
56 {
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
57 (*p)++;
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
58 l -> lint2 = 0;
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
59 }
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
60
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
61 // for compatibility with asxxxx
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
62 // * followed by a digit, alpha, or _, or ., or ?, or another * is "f8"
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
63 else if (**p == '*')
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
64 {
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
65 tv = *(*p + 1);
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
66 if (isdigit(tv) || isalpha(tv) || tv == '_' || tv == '.' || tv == '?' || tv == '@' || tv == '*' || tv == '+' || tv == '-')
339
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
67 {
361
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
68 l -> lint2 = 0;
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
69 (*p)++;
339
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
70 }
361
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
71 }
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
72 else if (**p == '>')
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
73 {
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
74 (*p)++;
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
75 l -> lint2 = 2;
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
76 }
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
77 else
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
78 {
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
79 l -> lint2 = -1;
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
80 }
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
81
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
82 s = lwasm_parse_expr(as, p);
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
83 if (!s)
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
84 {
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
85 lwasm_register_error(as, l, "Bad operand");
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
86 return;
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
87 }
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
88
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
89 lwasm_save_expr(l, 0, s);
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
90
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
91 if (as -> output_format == OUTPUT_OBJ && l -> lint2 == -1)
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
92 {
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
93 l -> lint2 = 2;
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
94 goto out;
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
95 }
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
96
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
97 // if we have a constant now, figure out dp vs nondp
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
98 if (lw_expr_istype(s, lw_expr_type_int))
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
99 {
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
100 v1 = lw_expr_intval(s);
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
101 if (((v1 >> 8) & 0xff) == (l -> dpval & 0xff))
339
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
102 {
361
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
103 l -> lint2 = 0;
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
104 goto out;
339
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
105 }
361
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
106 l -> lint2 = 2;
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
107 }
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
108
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
109 out:
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
110 if (l -> lint2 != -1)
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
111 {
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
112 if (l -> lint2 == 0)
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
113 {
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
114 l -> len = OPLEN(instab[l -> insn].ops[0]) + 1;
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
115 }
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
116 else if (l -> lint2 == 2)
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
117 {
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
118 l -> len = OPLEN(instab[l -> insn].ops[2]) + 2;
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
119 }
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
120 else if (l -> lint2 == 1 && l -> lint != -1)
339
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
121 {
361
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
122 l -> len = OPLEN(instab[l -> insn].ops[1]) + l -> lint + 1;
339
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
123 }
361
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
124 }
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
125 }
339
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
126
361
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
127 void insn_resolve_gen_aux(asmstate_t *as, line_t *l, int force)
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
128 {
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
129 lw_expr_t *e;
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
130
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
131 if (l -> lint2 == 1)
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
132 {
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
133 // indexed
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
134 insn_resolve_indexed_aux(as, l, force);
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
135 goto out;
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
136 }
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
137
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
138 if (l -> lint2 != -1)
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
139 return;
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
140
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
141 e = lwasm_fetch_expr(l, 0);
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
142 if (lw_expr_istype(e, lw_expr_type_int))
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
143 {
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
144 int v;
339
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
145
361
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
146 v = lw_expr_intval(e);
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
147
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
148 if (((v >> 8) & 0xff) == (l -> dpval & 0xff))
339
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
149 {
361
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
150 l -> lint2 = 0;
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
151 goto out;
339
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
152 }
361
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
153 l -> lint2 = 2;
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
154 goto out;
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
155 }
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
156
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
157 if (force)
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
158 {
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
159 l -> lint2 = 2;
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
160 }
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
161
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
162 out:
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
163 if (l -> lint2 != -1)
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
164 {
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
165 if (l -> lint2 == 0)
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
166 {
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
167 l -> len = OPLEN(instab[l -> insn].ops[0]) + 1;
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
168 }
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
169 else if (l -> lint2 == 2)
339
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
170 {
361
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
171 l -> len = OPLEN(instab[l -> insn].ops[2]) + 2;
339
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
172 }
361
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
173 else if (l -> lint2 == 1 && l -> lint != -1)
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
174 {
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
175 l -> len = OPLEN(instab[l -> insn].ops[1]) + l -> lint + 1;
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
176 }
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
177 }
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
178 }
339
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
179
362
4867f18c872f Added logic memory operands
lost@starbug
parents: 361
diff changeset
180 void insn_emit_gen_aux(asmstate_t *as, line_t *l, int extra)
361
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
181 {
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
182 lw_expr_t e;
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
183
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
184 e = lwasm_fetch_expr(l, 0);
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
185 lwasm_emitop(l, instab[l -> insn].ops[l -> lint2]);
362
4867f18c872f Added logic memory operands
lost@starbug
parents: 361
diff changeset
186
4867f18c872f Added logic memory operands
lost@starbug
parents: 361
diff changeset
187 if (extra != -1)
4867f18c872f Added logic memory operands
lost@starbug
parents: 361
diff changeset
188 lwasm_emit(l, extra);
4867f18c872f Added logic memory operands
lost@starbug
parents: 361
diff changeset
189
361
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
190 if (l, l -> lint2 == 1)
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
191 {
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
192 lwasm_emit(l, l -> pb);
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
193 lwasm_emitexpr(l, e, l -> lint);
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
194 return;
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
195 }
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
196
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
197 if (l -> lint2 == 2)
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
198 lwasm_emitexpr(l, e, 2);
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
199 else
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
200 lwasm_emitexpr(l, e, 1);
339
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
201 }
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
202
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
203 // the various insn_gen? functions have an immediate mode of ? bits
361
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
204 PARSEFUNC(insn_parse_gen0)
339
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
205 {
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
206 if (**p == '#')
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
207 {
361
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
208 lwasm_register_error(as, l, "Immediate mode not allowed");
339
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
209 return;
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
210 }
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
211
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
212 // handle non-immediate
361
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
213 insn_parse_gen_aux(as, l, p);
339
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
214 }
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
215
361
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
216 RESOLVEFUNC(insn_resolve_gen0)
339
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
217 {
361
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
218 if (l -> len != -1)
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
219 return;
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
220
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
221 // handle non-immediate
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
222 insn_resolve_gen_aux(as, l, force);
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
223 }
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
224
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
225 EMITFUNC(insn_emit_gen0)
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
226 {
362
4867f18c872f Added logic memory operands
lost@starbug
parents: 361
diff changeset
227 insn_emit_gen_aux(as, l, -1);
361
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
228 }
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
229
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
230 PARSEFUNC(insn_parse_gen8)
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
231 {
339
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
232 if (**p == '#')
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
233 {
361
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
234 lw_expr_t e;
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
235
339
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
236 (*p)++;
361
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
237 e = lwasm_parse_expr(as, p);
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
238 if (!e)
339
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
239 {
361
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
240 lwasm_register_error(as, l, "Bad operand");
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
241 return;
339
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
242 }
361
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
243 l -> len = OPLEN(instab[l -> insn].ops[3]) + 1;
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
244 l -> lint2 = 3;
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
245 lwasm_save_expr(l, 0, e);
339
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
246 return;
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
247 }
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
248
361
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
249 // handle non-immediate
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
250 insn_parse_gen_aux(as, l, p);
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
251 if (l -> lint2 != -1)
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
252 {
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
253 if (l -> lint2 == 0)
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
254 {
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
255 l -> len = OPLEN(instab[l -> insn].ops[0]) + 1;
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
256 }
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
257 else if (l -> lint2 == 2)
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
258 {
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
259 l -> len = OPLEN(instab[l -> insn].ops[2]) + 2;
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
260 }
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
261 else if (l -> lint2 == 1 && l -> lint != -1)
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
262 {
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
263 l -> len = OPLEN(instab[l -> insn].ops[1]) + l -> lint + 1;
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
264 }
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
265 }
339
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
266 }
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
267
361
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
268 RESOLVEFUNC(insn_resolve_gen8)
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
269 {
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
270 if (l -> len != -1)
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
271 return;
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
272
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
273 // handle non-immediate
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
274 insn_resolve_gen_aux(as, l, force);
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
275 }
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
276
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
277 EMITFUNC(insn_emit_gen8)
339
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
278 {
361
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
279 if (l -> lint2 == 3)
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
280 {
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
281 lw_expr_t e;
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
282 e = lwasm_fetch_expr(l, 0);
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
283 lwasm_emitop(l, instab[l -> insn].ops[3]);
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
284 lwasm_emitexpr(l, e, 1);
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
285 return;
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
286 }
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
287
362
4867f18c872f Added logic memory operands
lost@starbug
parents: 361
diff changeset
288 insn_emit_gen_aux(as, l, -1);
361
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
289 }
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
290
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
291 PARSEFUNC(insn_parse_gen16)
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
292 {
339
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
293 if (**p == '#')
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
294 {
361
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
295 lw_expr_t e;
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
296
339
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
297 (*p)++;
361
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
298 e = lwasm_parse_expr(as, p);
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
299 if (!e)
339
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
300 {
361
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
301 lwasm_register_error(as, l, "Bad operand");
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
302 return;
339
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
303 }
361
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
304 l -> len = OPLEN(instab[l -> insn].ops[3]) + 2;
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
305 l -> lint2 = 3;
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
306 lwasm_save_expr(l, 0, e);
339
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
307 return;
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
308 }
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
309
361
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
310 // handle non-immediate
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
311 insn_parse_gen_aux(as, l, p);
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
312 if (l -> lint2 != -1)
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
313 {
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
314 if (l -> lint2 == 0)
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
315 {
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
316 l -> len = OPLEN(instab[l -> insn].ops[0]) + 1;
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
317 }
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
318 else if (l -> lint2 == 2)
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
319 {
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
320 l -> len = OPLEN(instab[l -> insn].ops[2]) + 2;
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
321 }
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
322 else if (l -> lint2 == 1 && l -> lint != -1)
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
323 {
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
324 l -> len = OPLEN(instab[l -> insn].ops[1]) + l -> lint + 1;
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
325 }
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
326 }
339
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
327 }
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
328
361
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
329 RESOLVEFUNC(insn_resolve_gen16)
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
330 {
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
331 if (l -> len != -1)
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
332 return;
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
333
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
334 // handle non-immediate
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
335 insn_resolve_gen_aux(as, l, force);
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
336 }
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
337
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
338 EMITFUNC(insn_emit_gen16)
339
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
339 {
361
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
340 if (l -> lint2 == 3)
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
341 {
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
342 lw_expr_t e;
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
343 e = lwasm_fetch_expr(l, 0);
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
344 lwasm_emitop(l, instab[l -> insn].ops[3]);
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
345 lwasm_emitexpr(l, e, 2);
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
346 return;
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
347 }
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
348
362
4867f18c872f Added logic memory operands
lost@starbug
parents: 361
diff changeset
349 insn_emit_gen_aux(as, l, -1);
361
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
350 }
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
351
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
352 PARSEFUNC(insn_parse_gen32)
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
353 {
339
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
354 if (**p == '#')
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
355 {
361
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
356 lw_expr_t e;
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
357
339
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
358 (*p)++;
361
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
359 e = lwasm_parse_expr(as, p);
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
360 if (!e)
339
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
361 {
361
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
362 lwasm_register_error(as, l, "Bad operand");
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
363 return;
339
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
364 }
361
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
365 l -> len = OPLEN(instab[l -> insn].ops[3]) + 4;
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
366 l -> lint2 = 3;
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
367 lwasm_save_expr(l, 0, e);
339
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
368 return;
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
369 }
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
370
361
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
371 // handle non-immediate
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
372 insn_parse_gen_aux(as, l, p);
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
373 if (l -> lint2 != -1)
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
374 {
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
375 if (l -> lint2 == 0)
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
376 {
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
377 l -> len = OPLEN(instab[l -> insn].ops[0]) + 1;
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
378 }
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
379 else if (l -> lint2 == 2)
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
380 {
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
381 l -> len = OPLEN(instab[l -> insn].ops[2]) + 2;
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
382 }
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
383 else if (l -> lint2 == 1 && l -> lint != -1)
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
384 {
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
385 l -> len = OPLEN(instab[l -> insn].ops[1]) + l -> lint + 1;
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
386 }
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
387 }
339
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
388 }
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
389
361
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
390 RESOLVEFUNC(insn_resolve_gen32)
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
391 {
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
392 if (l -> len != -1)
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
393 return;
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
394
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
395 // handle non-immediate
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
396 insn_resolve_gen_aux(as, l, force);
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
397 }
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
398
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
399 EMITFUNC(insn_emit_gen32)
339
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
400 {
361
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
401 if (l -> lint2 == 3)
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
402 {
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
403 lw_expr_t e;
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
404 e = lwasm_fetch_expr(l, 0);
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
405 lwasm_emitop(l, instab[l -> insn].ops[3]);
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
406 lwasm_emitexpr(l, e, 4);
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
407 return;
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
408 }
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
409
362
4867f18c872f Added logic memory operands
lost@starbug
parents: 361
diff changeset
410 insn_emit_gen_aux(as, l, -1);
361
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
411 }
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
412
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
413 PARSEFUNC(insn_parse_imm8)
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
414 {
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
415 lw_expr_t e;
339
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
416
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
417 if (**p == '#')
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
418 {
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
419 (*p)++;
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
420
361
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
421 e = lwasm_parse_expr(as, p);
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
422 if (!e)
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
423 {
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
424 lwasm_register_error(as, l, "Bad operand");
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
425 return;
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
426 }
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
427 l -> len = OPLEN(instab[l -> insn].ops[0]) + 1;
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
428 lwasm_save_expr(l, 0, e);
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
429 }
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
430 }
339
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
431
361
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
432 EMITFUNC(insn_emit_imm8)
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
433 {
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
434 lw_expr_t e;
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
435
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
436 lwasm_emitop(l, instab[l -> insn].ops[0]);
105393e31f20 Generic memory mode insns
lost@starbug
parents: 339
diff changeset
437 lwasm_emitexpr(l, e, 1);
339
eb230fa7d28e Prepare for migration to hg
lost
parents:
diff changeset
438 }