Document change to -g internals
[nasm/avx512.git] / parser.c
blobb18277f8ae74a22a42a9578a791f9b2845d99859
1 /* parser.c source line parser for the Netwide Assembler
3 * The Netwide Assembler is copyright (C) 1996 Simon Tatham and
4 * Julian Hall. All rights reserved. The software is
5 * redistributable under the licence given in the file "Licence"
6 * distributed in the NASM archive.
8 * initial version 27/iii/95 by Simon Tatham
9 */
11 #include <stdio.h>
12 #include <stdlib.h>
13 #include <stddef.h>
14 #include <string.h>
15 #include <ctype.h>
17 #include "nasm.h"
18 #include "insns.h"
19 #include "nasmlib.h"
20 #include "parser.h"
21 #include "float.h"
23 extern int in_abs_seg; /* ABSOLUTE segment flag */
24 extern long abs_seg; /* ABSOLUTE segment */
25 extern long abs_offset; /* ABSOLUTE segment offset */
27 #include "regflags.c" /* List of register flags */
29 enum { /* special tokens */
30 S_BYTE, S_DWORD, S_FAR, S_LONG, S_NEAR, S_NOSPLIT, S_QWORD,
31 S_SHORT, S_STRICT, S_TO, S_TWORD, S_WORD
34 static int is_comma_next (void);
36 static int i;
37 static struct tokenval tokval;
38 static efunc error;
39 static struct ofmt *outfmt; /* Structure of addresses of output routines */
40 static loc_t *location; /* Pointer to current line's segment,offset */
42 void parser_global_info (struct ofmt *output, loc_t *locp)
44 outfmt = output;
45 location = locp;
48 insn *parse_line (int pass, char *buffer, insn *result,
49 efunc errfunc, evalfunc evaluate, ldfunc ldef)
51 int operand;
52 int critical;
53 struct eval_hints hints;
55 result->forw_ref = FALSE;
56 error = errfunc;
58 stdscan_reset();
59 stdscan_bufptr = buffer;
60 i = stdscan(NULL, &tokval);
62 result->label = NULL; /* Assume no label */
63 result->eops = NULL; /* must do this, whatever happens */
64 result->operands = 0; /* must initialise this */
66 if (i==0) { /* blank line - ignore */
67 result->opcode = -1; /* and no instruction either */
68 return result;
70 if (i != TOKEN_ID && i != TOKEN_INSN && i != TOKEN_PREFIX &&
71 (i!=TOKEN_REG || (REG_SREG & ~reg_flags[tokval.t_integer]))) {
72 error (ERR_NONFATAL, "label or instruction expected"
73 " at start of line");
74 result->opcode = -1;
75 return result;
78 if (i == TOKEN_ID) { /* there's a label here */
79 result->label = tokval.t_charptr;
80 i = stdscan(NULL, &tokval);
81 if (i == ':') { /* skip over the optional colon */
82 i = stdscan(NULL, &tokval);
83 } else if (i == 0) {
84 error (ERR_WARNING|ERR_WARN_OL|ERR_PASS1,
85 "label alone on a line without a colon might be in error");
87 if (i != TOKEN_INSN || tokval.t_integer != I_EQU)
90 * FIXME: location->segment could be NO_SEG, in which case
91 * it is possible we should be passing 'abs_seg'. Look into this.
92 * Work out whether that is *really* what we should be doing.
93 * Generally fix things. I think this is right as it is, but
94 * am still not certain.
96 ldef (result->label, in_abs_seg?abs_seg:location->segment,
97 location->offset, NULL, TRUE, FALSE, outfmt, errfunc);
101 if (i==0) {
102 result->opcode = -1; /* this line contains just a label */
103 return result;
106 result->nprefix = 0;
107 result->times = 1L;
109 while (i == TOKEN_PREFIX ||
110 (i==TOKEN_REG && !(REG_SREG & ~reg_flags[tokval.t_integer])))
113 * Handle special case: the TIMES prefix.
115 if (i == TOKEN_PREFIX && tokval.t_integer == P_TIMES) {
116 expr *value;
118 i = stdscan(NULL, &tokval);
119 value = evaluate (stdscan, NULL, &tokval, NULL, pass0, error, NULL);
120 i = tokval.t_type;
121 if (!value) { /* but, error in evaluator */
122 result->opcode = -1; /* unrecoverable parse error: */
123 return result; /* ignore this instruction */
125 if (!is_simple (value)) {
126 error (ERR_NONFATAL,
127 "non-constant argument supplied to TIMES");
128 result->times = 1L;
129 } else {
130 result->times = value->value;
131 if (value->value < 0) {
132 error(ERR_NONFATAL, "TIMES value %d is negative",
133 value->value);
134 result->times = 0;
137 } else {
138 if (result->nprefix == MAXPREFIX)
139 error (ERR_NONFATAL,
140 "instruction has more than %d prefixes", MAXPREFIX);
141 else
142 result->prefixes[result->nprefix++] = tokval.t_integer;
143 i = stdscan(NULL, &tokval);
147 if (i != TOKEN_INSN) {
148 if (result->nprefix > 0 && i == 0) {
150 * Instruction prefixes are present, but no actual
151 * instruction. This is allowed: at this point we
152 * invent a notional instruction of RESB 0.
154 result->opcode = I_RESB;
155 result->operands = 1;
156 result->oprs[0].type = IMMEDIATE;
157 result->oprs[0].offset = 0L;
158 result->oprs[0].segment = result->oprs[0].wrt = NO_SEG;
159 return result;
160 } else {
161 error (ERR_NONFATAL, "parser: instruction expected");
162 result->opcode = -1;
163 return result;
167 result->opcode = tokval.t_integer;
168 result->condition = tokval.t_inttwo;
171 * RESB, RESW and RESD cannot be satisfied with incorrectly
172 * evaluated operands, since the correct values _must_ be known
173 * on the first pass. Hence, even in pass one, we set the
174 * `critical' flag on calling evaluate(), so that it will bomb
175 * out on undefined symbols. Nasty, but there's nothing we can
176 * do about it.
178 * For the moment, EQU has the same difficulty, so we'll
179 * include that.
181 if (result->opcode == I_RESB ||
182 result->opcode == I_RESW ||
183 result->opcode == I_RESD ||
184 result->opcode == I_RESQ ||
185 result->opcode == I_REST ||
186 result->opcode == I_EQU ||
187 result->opcode == I_INCBIN) /* fbk */
189 critical = pass0;
191 else
192 critical = (pass==2 ? 2 : 0);
194 if (result->opcode == I_DB ||
195 result->opcode == I_DW ||
196 result->opcode == I_DD ||
197 result->opcode == I_DQ ||
198 result->opcode == I_DT ||
199 result->opcode == I_INCBIN)
201 extop *eop, **tail = &result->eops, **fixptr;
202 int oper_num = 0;
204 result->eops_float = FALSE;
207 * Begin to read the DB/DW/DD/DQ/DT/INCBIN operands.
209 while (1) {
210 i = stdscan(NULL, &tokval);
211 if (i == 0)
212 break;
213 fixptr = tail;
214 eop = *tail = nasm_malloc(sizeof(extop));
215 tail = &eop->next;
216 eop->next = NULL;
217 eop->type = EOT_NOTHING;
218 oper_num++;
220 if (i == TOKEN_NUM && tokval.t_charptr && is_comma_next()) {
221 eop->type = EOT_DB_STRING;
222 eop->stringval = tokval.t_charptr;
223 eop->stringlen = tokval.t_inttwo;
224 i = stdscan(NULL, &tokval); /* eat the comma */
225 continue;
228 if ((i == TOKEN_FLOAT && is_comma_next()) || i == '-') {
229 long sign = +1L;
231 if (i == '-') {
232 char *save = stdscan_bufptr;
233 i = stdscan(NULL, &tokval);
234 sign = -1L;
235 if (i != TOKEN_FLOAT || !is_comma_next()) {
236 stdscan_bufptr = save;
237 i = tokval.t_type = '-';
241 if (i == TOKEN_FLOAT) {
242 eop->type = EOT_DB_STRING;
243 result->eops_float = TRUE;
244 if (result->opcode == I_DD)
245 eop->stringlen = 4;
246 else if (result->opcode == I_DQ)
247 eop->stringlen = 8;
248 else if (result->opcode == I_DT)
249 eop->stringlen = 10;
250 else {
251 error(ERR_NONFATAL, "floating-point constant"
252 " encountered in `D%c' instruction",
253 result->opcode == I_DW ? 'W' : 'B');
255 * fix suggested by Pedro Gimeno... original line
256 * was:
257 * eop->type = EOT_NOTHING;
259 eop->stringlen = 0;
261 eop = nasm_realloc(eop, sizeof(extop)+eop->stringlen);
262 tail = &eop->next;
263 *fixptr = eop;
264 eop->stringval = (char *)eop + sizeof(extop);
265 if (eop->stringlen < 4 ||
266 !float_const (tokval.t_charptr, sign,
267 (unsigned char *)eop->stringval,
268 eop->stringlen, error))
269 eop->type = EOT_NOTHING;
270 i = stdscan(NULL, &tokval); /* eat the comma */
271 continue;
275 /* anything else */
277 expr *value;
278 value = evaluate (stdscan, NULL, &tokval, NULL,
279 critical, error, NULL);
280 i = tokval.t_type;
281 if (!value) { /* error in evaluator */
282 result->opcode = -1;/* unrecoverable parse error: */
283 return result; /* ignore this instruction */
285 if (is_unknown(value)) {
286 eop->type = EOT_DB_NUMBER;
287 eop->offset = 0; /* doesn't matter what we put */
288 eop->segment = eop->wrt = NO_SEG; /* likewise */
289 } else if (is_reloc(value)) {
290 eop->type = EOT_DB_NUMBER;
291 eop->offset = reloc_value(value);
292 eop->segment = reloc_seg(value);
293 eop->wrt = reloc_wrt(value);
294 } else {
295 error (ERR_NONFATAL,
296 "operand %d: expression is not simple"
297 " or relocatable", oper_num);
302 * We're about to call stdscan(), which will eat the
303 * comma that we're currently sitting on between
304 * arguments. However, we'd better check first that it
305 * _is_ a comma.
307 if (i == 0) /* also could be EOL */
308 break;
309 if (i != ',') {
310 error (ERR_NONFATAL, "comma expected after operand %d",
311 oper_num);
312 result->opcode = -1;/* unrecoverable parse error: */
313 return result; /* ignore this instruction */
317 if (result->opcode == I_INCBIN) {
319 * Correct syntax for INCBIN is that there should be
320 * one string operand, followed by one or two numeric
321 * operands.
323 if (!result->eops || result->eops->type != EOT_DB_STRING)
324 error (ERR_NONFATAL, "`incbin' expects a file name");
325 else if (result->eops->next &&
326 result->eops->next->type != EOT_DB_NUMBER)
327 error (ERR_NONFATAL, "`incbin': second parameter is",
328 " non-numeric");
329 else if (result->eops->next && result->eops->next->next &&
330 result->eops->next->next->type != EOT_DB_NUMBER)
331 error (ERR_NONFATAL, "`incbin': third parameter is",
332 " non-numeric");
333 else if (result->eops->next && result->eops->next->next &&
334 result->eops->next->next->next)
335 error (ERR_NONFATAL, "`incbin': more than three parameters");
336 else
337 return result;
339 * If we reach here, one of the above errors happened.
340 * Throw the instruction away.
342 result->opcode = -1;
343 return result;
344 } else /* DB ... */
345 if (oper_num == 0)
346 error (ERR_WARNING|ERR_PASS1,
347 "no operand for data declaration");
348 else
349 result->operands = oper_num;
351 return result;
354 /* right. Now we begin to parse the operands. There may be up to three
355 * of these, separated by commas, and terminated by a zero token. */
357 for (operand = 0; operand < 3; operand++) {
358 expr *value; /* used most of the time */
359 int mref; /* is this going to be a memory ref? */
360 int bracket; /* is it a [] mref, or a & mref? */
361 int setsize = 0;
363 result->oprs[operand].addr_size = 0;/* have to zero this whatever */
364 result->oprs[operand].eaflags = 0; /* and this */
365 result->oprs[operand].opflags = 0;
367 i = stdscan(NULL, &tokval);
368 if (i == 0) break; /* end of operands: get out of here */
369 result->oprs[operand].type = 0; /* so far, no override */
370 while (i == TOKEN_SPECIAL) {/* size specifiers */
371 switch ((int)tokval.t_integer) {
372 case S_BYTE:
373 if (!setsize) /* we want to use only the first */
374 result->oprs[operand].type |= BITS8;
375 setsize = 1;
376 break;
377 case S_WORD:
378 if (!setsize)
379 result->oprs[operand].type |= BITS16;
380 setsize = 1;
381 break;
382 case S_DWORD:
383 case S_LONG:
384 if (!setsize)
385 result->oprs[operand].type |= BITS32;
386 setsize = 1;
387 break;
388 case S_QWORD:
389 if (!setsize)
390 result->oprs[operand].type |= BITS64;
391 setsize = 1;
392 break;
393 case S_TWORD:
394 if (!setsize)
395 result->oprs[operand].type |= BITS80;
396 setsize = 1;
397 break;
398 case S_TO:
399 result->oprs[operand].type |= TO;
400 break;
401 case S_STRICT:
402 result->oprs[operand].type |= STRICT;
403 break;
404 case S_FAR:
405 result->oprs[operand].type |= FAR;
406 break;
407 case S_NEAR:
408 result->oprs[operand].type |= NEAR;
409 break;
410 case S_SHORT:
411 result->oprs[operand].type |= SHORT;
412 break;
413 default:
414 error (ERR_NONFATAL, "invalid operand size specification");
416 i = stdscan(NULL, &tokval);
419 if (i == '[' || i == '&') { /* memory reference */
420 mref = TRUE;
421 bracket = (i == '[');
422 i = stdscan(NULL, &tokval);
423 if (i == TOKEN_SPECIAL) { /* check for address size override */
424 if (tasm_compatible_mode) {
425 switch ((int)tokval.t_integer) {
426 /* For TASM compatibility a size override inside the
427 * brackets changes the size of the operand, not the
428 * address type of the operand as it does in standard
429 * NASM syntax. Hence:
431 * mov eax,[DWORD val]
433 * is valid syntax in TASM compatibility mode. Note that
434 * you lose the ability to override the default address
435 * type for the instruction, but we never use anything
436 * but 32-bit flat model addressing in our code.
438 case S_BYTE:
439 result->oprs[operand].type |= BITS8;
440 break;
441 case S_WORD:
442 result->oprs[operand].type |= BITS16;
443 break;
444 case S_DWORD:
445 case S_LONG:
446 result->oprs[operand].type |= BITS32;
447 break;
448 case S_QWORD:
449 result->oprs[operand].type |= BITS64;
450 break;
451 case S_TWORD:
452 result->oprs[operand].type |= BITS80;
453 break;
454 default:
455 error (ERR_NONFATAL, "invalid operand size specification");
457 } else {
458 /* Standard NASM compatible syntax */
459 switch ((int)tokval.t_integer) {
460 case S_NOSPLIT:
461 result->oprs[operand].eaflags |= EAF_TIMESTWO;
462 break;
463 case S_BYTE:
464 result->oprs[operand].eaflags |= EAF_BYTEOFFS;
465 break;
466 case S_WORD:
467 result->oprs[operand].addr_size = 16;
468 result->oprs[operand].eaflags |= EAF_WORDOFFS;
469 break;
470 case S_DWORD:
471 case S_LONG:
472 result->oprs[operand].addr_size = 32;
473 result->oprs[operand].eaflags |= EAF_WORDOFFS;
474 break;
475 default:
476 error (ERR_NONFATAL, "invalid size specification in"
477 " effective address");
480 i = stdscan(NULL, &tokval);
482 } else { /* immediate operand, or register */
483 mref = FALSE;
484 bracket = FALSE; /* placate optimisers */
487 if((result->oprs[operand].type & FAR) && !mref &&
488 result->opcode != I_JMP && result->opcode != I_CALL)
490 error (ERR_NONFATAL, "invalid use of FAR operand specifier");
493 value = evaluate (stdscan, NULL, &tokval,
494 &result->oprs[operand].opflags,
495 critical, error, &hints);
496 i = tokval.t_type;
497 if (result->oprs[operand].opflags & OPFLAG_FORWARD) {
498 result->forw_ref = TRUE;
500 if (!value) { /* error in evaluator */
501 result->opcode = -1; /* unrecoverable parse error: */
502 return result; /* ignore this instruction */
504 if (i == ':' && mref) { /* it was seg:offset */
506 * Process the segment override.
508 if (value[1].type!=0 || value->value!=1 ||
509 REG_SREG & ~reg_flags[value->type])
510 error (ERR_NONFATAL, "invalid segment override");
511 else if (result->nprefix == MAXPREFIX)
512 error (ERR_NONFATAL,
513 "instruction has more than %d prefixes",
514 MAXPREFIX);
515 else
516 result->prefixes[result->nprefix++] = value->type;
518 i = stdscan(NULL, &tokval); /* then skip the colon */
519 if (i == TOKEN_SPECIAL) { /* another check for size override */
520 switch ((int)tokval.t_integer) {
521 case S_WORD:
522 result->oprs[operand].addr_size = 16;
523 break;
524 case S_DWORD:
525 case S_LONG:
526 result->oprs[operand].addr_size = 32;
527 break;
528 default:
529 error (ERR_NONFATAL, "invalid size specification in"
530 " effective address");
532 i = stdscan(NULL, &tokval);
534 value = evaluate (stdscan, NULL, &tokval,
535 &result->oprs[operand].opflags,
536 critical, error, &hints);
537 i = tokval.t_type;
538 if (result->oprs[operand].opflags & OPFLAG_FORWARD) {
539 result->forw_ref = TRUE;
541 /* and get the offset */
542 if (!value) { /* but, error in evaluator */
543 result->opcode = -1; /* unrecoverable parse error: */
544 return result; /* ignore this instruction */
547 if (mref && bracket) { /* find ] at the end */
548 if (i != ']') {
549 error (ERR_NONFATAL, "parser: expecting ]");
550 do { /* error recovery again */
551 i = stdscan(NULL, &tokval);
552 } while (i != 0 && i != ',');
553 } else /* we got the required ] */
554 i = stdscan(NULL, &tokval);
555 } else { /* immediate operand */
556 if (i != 0 && i != ',' && i != ':') {
557 error (ERR_NONFATAL, "comma or end of line expected");
558 do { /* error recovery */
559 i = stdscan(NULL, &tokval);
560 } while (i != 0 && i != ',');
561 } else if (i == ':') {
562 result->oprs[operand].type |= COLON;
566 /* now convert the exprs returned from evaluate() into operand
567 * descriptions... */
569 if (mref) { /* it's a memory reference */
570 expr *e = value;
571 int b, i, s; /* basereg, indexreg, scale */
572 long o; /* offset */
574 b = i = -1, o = s = 0;
575 result->oprs[operand].hintbase = hints.base;
576 result->oprs[operand].hinttype = hints.type;
578 if (e->type && e->type <= EXPR_REG_END) /* this bit's a register */
580 if (e->value == 1) /* in fact it can be basereg */
581 b = e->type;
582 else /* no, it has to be indexreg */
583 i = e->type, s = e->value;
584 e++;
586 if (e->type && e->type <= EXPR_REG_END) /* it's a 2nd register */
588 if (b != -1) /* If the first was the base, ... */
589 i = e->type, s = e->value; /* second has to be indexreg */
591 else if (e->value != 1) /* If both want to be index */
593 error(ERR_NONFATAL, "beroset-p-592-invalid effective address");
594 result->opcode = -1;
595 return result;
597 else
598 b = e->type;
599 e++;
601 if (e->type != 0) { /* is there an offset? */
602 if (e->type <= EXPR_REG_END) /* in fact, is there an error? */
604 error (ERR_NONFATAL, "beroset-p-603-invalid effective address");
605 result->opcode = -1;
606 return result;
608 else
610 if (e->type == EXPR_UNKNOWN) {
611 o = 0; /* doesn't matter what */
612 result->oprs[operand].wrt = NO_SEG; /* nor this */
613 result->oprs[operand].segment = NO_SEG; /* or this */
614 while (e->type) e++; /* go to the end of the line */
616 else
618 if (e->type == EXPR_SIMPLE) {
619 o = e->value;
620 e++;
622 if (e->type == EXPR_WRT) {
623 result->oprs[operand].wrt = e->value;
624 e++;
625 } else
626 result->oprs[operand].wrt = NO_SEG;
628 * Look for a segment base type.
630 if (e->type && e->type < EXPR_SEGBASE) {
631 error (ERR_NONFATAL, "beroset-p-630-invalid effective address");
632 result->opcode = -1;
633 return result;
635 while (e->type && e->value == 0)
636 e++;
637 if (e->type && e->value != 1) {
638 error (ERR_NONFATAL, "beroset-p-637-invalid effective address");
639 result->opcode = -1;
640 return result;
642 if (e->type) {
643 result->oprs[operand].segment =
644 e->type - EXPR_SEGBASE;
645 e++;
646 } else
647 result->oprs[operand].segment = NO_SEG;
648 while (e->type && e->value == 0)
649 e++;
650 if (e->type) {
651 error (ERR_NONFATAL, "beroset-p-650-invalid effective address");
652 result->opcode = -1;
653 return result;
657 } else {
658 o = 0;
659 result->oprs[operand].wrt = NO_SEG;
660 result->oprs[operand].segment = NO_SEG;
663 if (e->type != 0) { /* there'd better be nothing left! */
664 error (ERR_NONFATAL, "beroset-p-663-invalid effective address");
665 result->opcode = -1;
666 return result;
669 result->oprs[operand].type |= MEMORY;
670 if (b==-1 && (i==-1 || s==0))
671 result->oprs[operand].type |= MEM_OFFS;
672 result->oprs[operand].basereg = b;
673 result->oprs[operand].indexreg = i;
674 result->oprs[operand].scale = s;
675 result->oprs[operand].offset = o;
677 else /* it's not a memory reference */
679 if (is_just_unknown(value)) { /* it's immediate but unknown */
680 result->oprs[operand].type |= IMMEDIATE;
681 result->oprs[operand].offset = 0; /* don't care */
682 result->oprs[operand].segment = NO_SEG; /* don't care again */
683 result->oprs[operand].wrt = NO_SEG;/* still don't care */
685 else if (is_reloc(value)) /* it's immediate */
687 result->oprs[operand].type |= IMMEDIATE;
688 result->oprs[operand].offset = reloc_value(value);
689 result->oprs[operand].segment = reloc_seg(value);
690 result->oprs[operand].wrt = reloc_wrt(value);
691 if (is_simple(value)) {
692 if (reloc_value(value)==1)
693 result->oprs[operand].type |= UNITY;
694 if (optimizing>=0 &&
695 !(result->oprs[operand].type & STRICT)) {
696 if (reloc_value(value) >= -128 &&
697 reloc_value(value) <= 127)
698 result->oprs[operand].type |= SBYTE;
702 else /* it's a register */
704 if (value->type>=EXPR_SIMPLE || value->value!=1) {
705 error (ERR_NONFATAL, "invalid operand type");
706 result->opcode = -1;
707 return result;
711 * check that its only 1 register, not an expression...
713 for (i = 1; value[i].type; i++)
714 if (value[i].value) {
715 error (ERR_NONFATAL, "invalid operand type");
716 result->opcode = -1;
717 return result;
720 /* clear overrides, except TO which applies to FPU regs */
721 if (result->oprs[operand].type & ~TO) {
723 * we want to produce a warning iff the specified size
724 * is different from the register size
726 i = result->oprs[operand].type & SIZE_MASK;
728 else
729 i = 0;
731 result->oprs[operand].type &= TO;
732 result->oprs[operand].type |= REGISTER;
733 result->oprs[operand].type |= reg_flags[value->type];
734 result->oprs[operand].basereg = value->type;
736 if (i && (result->oprs[operand].type & SIZE_MASK) != i)
737 error (ERR_WARNING|ERR_PASS1,
738 "register size specification ignored");
743 result->operands = operand; /* set operand count */
745 while (operand<3) /* clear remaining operands */
746 result->oprs[operand++].type = 0;
749 * Transform RESW, RESD, RESQ, REST into RESB.
751 switch (result->opcode) {
752 case I_RESW: result->opcode=I_RESB; result->oprs[0].offset*=2; break;
753 case I_RESD: result->opcode=I_RESB; result->oprs[0].offset*=4; break;
754 case I_RESQ: result->opcode=I_RESB; result->oprs[0].offset*=8; break;
755 case I_REST: result->opcode=I_RESB; result->oprs[0].offset*=10; break;
758 return result;
761 static int is_comma_next (void)
763 char *p;
764 int i;
765 struct tokenval tv;
767 p = stdscan_bufptr;
768 i = stdscan (NULL, &tv);
769 stdscan_bufptr = p;
770 return (i == ',' || i == ';' || !i);
773 void cleanup_insn (insn *i)
775 extop *e;
777 while (i->eops) {
778 e = i->eops;
779 i->eops = i->eops->next;
780 nasm_free (e);