~bkerensa/ubuntu/raring/yasm/fix-for-1064341

« back to all changes in this revision

Viewing changes to libyasm/insn.h

  • Committer: Bazaar Package Importer
  • Author(s): Sam Hocevar
  • Date: 2009-07-14 08:23:59 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20090714082359-10x8mjty41gzkshs
Tags: 0.8.0-1
* New upstream release (Closes: #531047).
* Removed all tasm patches, they’ve been merged upstream.
* debian/control: set debhelper dependency to 5.0 and policy to 3.8.2.
* debian/control: mention TASM in the long description.
* debian/compat: set debhelper level to 5.
* debian/links: link tasm to ytasm and tasm.1.gz to ytasm.1.gz.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
 * \brief YASM mnenomic instruction.
4
4
 *
5
5
 * \rcs
6
 
 * $Id: insn.h 2028 2008-01-19 08:59:19Z peter $
 
6
 * $Id: insn.h 2130 2008-10-07 05:38:11Z peter $
7
7
 * \endrcs
8
8
 *
9
9
 * \license
34
34
#ifndef YASM_INSN_H
35
35
#define YASM_INSN_H
36
36
 
 
37
#ifndef YASM_LIB_DECL
 
38
#define YASM_LIB_DECL
 
39
#endif
 
40
 
37
41
/** Base structure for an effective address.  As with all base
38
42
 * structures, must be present as the first element in any
39
43
 * #yasm_arch implementation of an effective address.
70
74
 
71
75
    /** 1 if effective address is forced non-PC-relative. */
72
76
    unsigned int not_pc_rel:1;
 
77
 
 
78
    /** length of pointed data (in bytes), 0 if unknown. */
 
79
    unsigned int data_len;
73
80
};
74
81
 
75
82
/** An instruction operand (opaque type). */
154
161
 * \param ea            effective address
155
162
 * \param segreg        segment register (0 if none)
156
163
 */
 
164
YASM_LIB_DECL
157
165
void yasm_ea_set_segreg(yasm_effaddr *ea, uintptr_t segreg);
158
166
 
159
167
/** Create an instruction operand from a register.
160
168
 * \param reg   register
161
169
 * \return Newly allocated operand.
162
170
 */
 
171
YASM_LIB_DECL
163
172
yasm_insn_operand *yasm_operand_create_reg(uintptr_t reg);
164
173
 
165
174
/** Create an instruction operand from a segment register.
166
175
 * \param segreg        segment register
167
176
 * \return Newly allocated operand.
168
177
 */
 
178
YASM_LIB_DECL
169
179
yasm_insn_operand *yasm_operand_create_segreg(uintptr_t segreg);
170
180
 
171
181
/** Create an instruction operand from an effective address.
172
182
 * \param ea    effective address
173
183
 * \return Newly allocated operand.
174
184
 */
 
185
YASM_LIB_DECL
175
186
yasm_insn_operand *yasm_operand_create_mem(/*@only@*/ yasm_effaddr *ea);
176
187
 
177
188
/** Create an instruction operand from an immediate expression.
180
191
 * \param val   immediate expression
181
192
 * \return Newly allocated operand.
182
193
 */
 
194
YASM_LIB_DECL
183
195
yasm_insn_operand *yasm_operand_create_imm(/*@only@*/ yasm_expr *val);
184
196
 
185
197
/** Get the first operand in an instruction.
205
217
 * \return If operand was actually appended (it wasn't NULL), the operand;
206
218
 *         otherwise NULL.
207
219
 */
 
220
YASM_LIB_DECL
208
221
/*@null@*/ yasm_insn_operand *yasm_insn_ops_append
209
222
    (yasm_insn *insn,
210
223
     /*@returned@*/ /*@null@*/ yasm_insn_operand *op);
213
226
 * \param insn          instruction
214
227
 * \param prefix        data that identifies the prefix
215
228
 */
 
229
YASM_LIB_DECL
216
230
void yasm_insn_add_prefix(yasm_insn *insn, uintptr_t prefix);
217
231
 
218
232
/** Associate a segment prefix with an instruction.
219
233
 * \param insn          instruction
220
234
 * \param segreg        data that identifies the segment register
221
235
 */
 
236
YASM_LIB_DECL
222
237
void yasm_insn_add_seg_prefix(yasm_insn *insn, uintptr_t segreg);
223
238
 
224
239
/** Initialize the common parts of an instruction.
225
240
 * \internal For use by yasm_arch implementations only.
226
241
 * \param insn          instruction
227
242
 */
 
243
YASM_LIB_DECL
228
244
void yasm_insn_initialize(/*@out@*/ yasm_insn *insn);
229
245
 
230
246
/** Delete the common parts of an instruction.
233
249
 * \param content       if nonzero, deletes content of each operand
234
250
 * \param arch          architecture
235
251
 */
 
252
YASM_LIB_DECL
236
253
void yasm_insn_delete(yasm_insn *insn,
237
254
                      void (*ea_destroy) (/*@only@*/ yasm_effaddr *));
238
255
 
243
260
 * \param indent_level  indentation level
244
261
 * \param arch          architecture
245
262
 */
 
263
YASM_LIB_DECL
246
264
void yasm_insn_print(const yasm_insn *insn, FILE *f, int indent_level);
247
265
 
248
266
/** Finalize the common parts of an instruction.
249
267
 * \internal For use by yasm_arch implementations only.
250
268
 * \param insn          instruction
251
269
 */
 
270
YASM_LIB_DECL
252
271
void yasm_insn_finalize(yasm_insn *insn);
253
272
 
254
273
#endif