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 license given in the file "LICENSE"
6 * distributed in the NASM archive.
8 * initial version 27/iii/95 by Simon Tatham
28 extern int in_abs_seg
; /* ABSOLUTE segment flag */
29 extern int32_t abs_seg
; /* ABSOLUTE segment */
30 extern int32_t abs_offset
; /* ABSOLUTE segment offset */
32 static int is_comma_next(void);
35 static struct tokenval tokval
;
37 static struct ofmt
*outfmt
; /* Structure of addresses of output routines */
38 static struct location
*location
; /* Pointer to current line's segment,offset */
40 void parser_global_info(struct ofmt
*output
, struct location
* locp
)
46 static int prefix_slot(enum prefixes prefix
)
74 error(ERR_PANIC
, "Invalid value %d passed to prefix_slot()", prefix
);
79 static void process_size_override(insn
* result
, int operand
)
81 if (tasm_compatible_mode
) {
82 switch ((int)tokval
.t_integer
) {
83 /* For TASM compatibility a size override inside the
84 * brackets changes the size of the operand, not the
85 * address type of the operand as it does in standard
90 * is valid syntax in TASM compatibility mode. Note that
91 * you lose the ability to override the default address
92 * type for the instruction, but we never use anything
93 * but 32-bit flat model addressing in our code.
96 result
->oprs
[operand
].type
|= BITS8
;
99 result
->oprs
[operand
].type
|= BITS16
;
103 result
->oprs
[operand
].type
|= BITS32
;
106 result
->oprs
[operand
].type
|= BITS64
;
109 result
->oprs
[operand
].type
|= BITS80
;
112 result
->oprs
[operand
].type
|= BITS128
;
116 "invalid operand size specification");
120 /* Standard NASM compatible syntax */
121 switch ((int)tokval
.t_integer
) {
123 result
->oprs
[operand
].eaflags
|= EAF_TIMESTWO
;
126 result
->oprs
[operand
].eaflags
|= EAF_REL
;
129 result
->oprs
[operand
].eaflags
|= EAF_ABS
;
132 result
->oprs
[operand
].disp_size
= 8;
133 result
->oprs
[operand
].eaflags
|= EAF_BYTEOFFS
;
138 if (result
->prefixes
[PPS_ASIZE
] &&
139 result
->prefixes
[PPS_ASIZE
] != tokval
.t_integer
)
141 "conflicting address size specifications");
143 result
->prefixes
[PPS_ASIZE
] = tokval
.t_integer
;
146 result
->oprs
[operand
].disp_size
= 16;
147 result
->oprs
[operand
].eaflags
|= EAF_WORDOFFS
;
151 result
->oprs
[operand
].disp_size
= 32;
152 result
->oprs
[operand
].eaflags
|= EAF_WORDOFFS
;
155 result
->oprs
[operand
].disp_size
= 64;
156 result
->oprs
[operand
].eaflags
|= EAF_WORDOFFS
;
159 error(ERR_NONFATAL
, "invalid size specification in"
160 " effective address");
166 insn
*parse_line(int pass
, char *buffer
, insn
* result
,
167 efunc errfunc
, evalfunc evaluate
, ldfunc ldef
)
171 struct eval_hints hints
;
174 bool insn_is_label
= false;
178 result
->forw_ref
= false;
182 stdscan_bufptr
= buffer
;
183 i
= stdscan(NULL
, &tokval
);
185 result
->label
= NULL
; /* Assume no label */
186 result
->eops
= NULL
; /* must do this, whatever happens */
187 result
->operands
= 0; /* must initialize this */
189 if (i
== 0) { /* blank line - ignore */
190 result
->opcode
= -1; /* and no instruction either */
193 if (i
!= TOKEN_ID
&& i
!= TOKEN_INSN
&& i
!= TOKEN_PREFIX
&&
194 (i
!= TOKEN_REG
|| (REG_SREG
& ~nasm_reg_flags
[tokval
.t_integer
]))) {
195 error(ERR_NONFATAL
, "label or instruction expected"
196 " at start of line");
201 if (i
== TOKEN_ID
|| (insn_is_label
&& i
== TOKEN_INSN
)) {
202 /* there's a label here */
204 result
->label
= tokval
.t_charptr
;
205 i
= stdscan(NULL
, &tokval
);
206 if (i
== ':') { /* skip over the optional colon */
207 i
= stdscan(NULL
, &tokval
);
209 error(ERR_WARNING
| ERR_WARN_OL
| ERR_PASS1
,
210 "label alone on a line without a colon might be in error");
212 if (i
!= TOKEN_INSN
|| tokval
.t_integer
!= I_EQU
) {
214 * FIXME: location->segment could be NO_SEG, in which case
215 * it is possible we should be passing 'abs_seg'. Look into this.
216 * Work out whether that is *really* what we should be doing.
217 * Generally fix things. I think this is right as it is, but
218 * am still not certain.
220 ldef(result
->label
, in_abs_seg
? abs_seg
: location
->segment
,
221 location
->offset
, NULL
, true, false, outfmt
, errfunc
);
226 result
->opcode
= -1; /* this line contains just a label */
230 for (j
= 0; j
< MAXPREFIX
; j
++)
231 result
->prefixes
[j
] = P_none
;
234 while (i
== TOKEN_PREFIX
||
235 (i
== TOKEN_REG
&& !(REG_SREG
& ~nasm_reg_flags
[tokval
.t_integer
])))
240 * Handle special case: the TIMES prefix.
242 if (i
== TOKEN_PREFIX
&& tokval
.t_integer
== P_TIMES
) {
245 i
= stdscan(NULL
, &tokval
);
247 evaluate(stdscan
, NULL
, &tokval
, NULL
, pass0
, error
, NULL
);
249 if (!value
) { /* but, error in evaluator */
250 result
->opcode
= -1; /* unrecoverable parse error: */
251 return result
; /* ignore this instruction */
253 if (!is_simple(value
)) {
255 "non-constant argument supplied to TIMES");
258 result
->times
= value
->value
;
259 if (value
->value
< 0) {
260 error(ERR_NONFATAL
, "TIMES value %d is negative",
266 int slot
= prefix_slot(tokval
.t_integer
);
267 if (result
->prefixes
[slot
]) {
268 if (result
->prefixes
[slot
] == tokval
.t_integer
)
270 "instruction has redundant prefixes");
273 "instruction has conflicting prefixes");
275 result
->prefixes
[slot
] = tokval
.t_integer
;
276 i
= stdscan(NULL
, &tokval
);
280 if (i
!= TOKEN_INSN
) {
284 for (j
= 0; j
< MAXPREFIX
; j
++)
285 if ((pfx
= result
->prefixes
[j
]) != P_none
)
288 if (i
== 0 && pfx
!= P_none
) {
290 * Instruction prefixes are present, but no actual
291 * instruction. This is allowed: at this point we
292 * invent a notional instruction of RESB 0.
294 result
->opcode
= I_RESB
;
295 result
->operands
= 1;
296 result
->oprs
[0].type
= IMMEDIATE
;
297 result
->oprs
[0].offset
= 0L;
298 result
->oprs
[0].segment
= result
->oprs
[0].wrt
= NO_SEG
;
301 error(ERR_NONFATAL
, "parser: instruction expected");
307 result
->opcode
= tokval
.t_integer
;
308 result
->condition
= tokval
.t_inttwo
;
311 * RESB, RESW and RESD cannot be satisfied with incorrectly
312 * evaluated operands, since the correct values _must_ be known
313 * on the first pass. Hence, even in pass one, we set the
314 * `critical' flag on calling evaluate(), so that it will bomb
315 * out on undefined symbols. Nasty, but there's nothing we can
318 * For the moment, EQU has the same difficulty, so we'll
321 if (result
->opcode
== I_RESB
|| result
->opcode
== I_RESW
||
322 result
->opcode
== I_RESD
|| result
->opcode
== I_RESQ
||
323 result
->opcode
== I_REST
|| result
->opcode
== I_RESO
||
324 result
->opcode
== I_RESY
||
325 result
->opcode
== I_INCBIN
) {
326 critical
= (pass0
< 2 ? 1 : 2);
329 critical
= (pass
== 2 ? 2 : 0);
331 if (result
->opcode
== I_DB
|| result
->opcode
== I_DW
||
332 result
->opcode
== I_DD
|| result
->opcode
== I_DQ
||
333 result
->opcode
== I_DT
|| result
->opcode
== I_DO
||
334 result
->opcode
== I_DY
|| result
->opcode
== I_INCBIN
) {
335 extop
*eop
, **tail
= &result
->eops
, **fixptr
;
338 result
->eops_float
= false;
341 * Begin to read the DB/DW/DD/DQ/DT/DO/INCBIN operands.
344 i
= stdscan(NULL
, &tokval
);
347 else if (first
&& i
== ':') {
348 insn_is_label
= true;
353 eop
= *tail
= nasm_malloc(sizeof(extop
));
356 eop
->type
= EOT_NOTHING
;
359 if (i
== TOKEN_NUM
&& tokval
.t_charptr
&& is_comma_next()) {
360 eop
->type
= EOT_DB_STRING
;
361 eop
->stringval
= tokval
.t_charptr
;
362 eop
->stringlen
= tokval
.t_inttwo
;
363 i
= stdscan(NULL
, &tokval
); /* eat the comma */
367 if ((i
== TOKEN_FLOAT
&& is_comma_next())
368 || i
== '-' || i
== '+') {
371 if (i
== '+' || i
== '-') {
372 char *save
= stdscan_bufptr
;
374 sign
= (i
== '-') ? -1 : 1;
375 i
= stdscan(NULL
, &tokval
);
376 if (i
!= TOKEN_FLOAT
|| !is_comma_next()) {
377 stdscan_bufptr
= save
;
378 i
= tokval
.t_type
= token
;
382 if (i
== TOKEN_FLOAT
) {
383 eop
->type
= EOT_DB_STRING
;
384 result
->eops_float
= true;
385 switch (result
->opcode
) {
405 error(ERR_NONFATAL
, "floating-point constant"
406 " encountered in DY instruction");
410 error(ERR_NONFATAL
, "floating-point constant"
411 " encountered in unknown instruction");
413 * fix suggested by Pedro Gimeno... original line
415 * eop->type = EOT_NOTHING;
420 eop
= nasm_realloc(eop
, sizeof(extop
) + eop
->stringlen
);
423 eop
->stringval
= (char *)eop
+ sizeof(extop
);
424 if (!eop
->stringlen
||
425 !float_const(tokval
.t_charptr
, sign
,
426 (uint8_t *)eop
->stringval
,
427 eop
->stringlen
, error
))
428 eop
->type
= EOT_NOTHING
;
429 i
= stdscan(NULL
, &tokval
); /* eat the comma */
437 value
= evaluate(stdscan
, NULL
, &tokval
, NULL
,
438 critical
, error
, NULL
);
440 if (!value
) { /* error in evaluator */
441 result
->opcode
= -1; /* unrecoverable parse error: */
442 return result
; /* ignore this instruction */
444 if (is_unknown(value
)) {
445 eop
->type
= EOT_DB_NUMBER
;
446 eop
->offset
= 0; /* doesn't matter what we put */
447 eop
->segment
= eop
->wrt
= NO_SEG
; /* likewise */
448 } else if (is_reloc(value
)) {
449 eop
->type
= EOT_DB_NUMBER
;
450 eop
->offset
= reloc_value(value
);
451 eop
->segment
= reloc_seg(value
);
452 eop
->wrt
= reloc_wrt(value
);
455 "operand %d: expression is not simple"
456 " or relocatable", oper_num
);
461 * We're about to call stdscan(), which will eat the
462 * comma that we're currently sitting on between
463 * arguments. However, we'd better check first that it
466 if (i
== 0) /* also could be EOL */
469 error(ERR_NONFATAL
, "comma expected after operand %d",
471 result
->opcode
= -1; /* unrecoverable parse error: */
472 return result
; /* ignore this instruction */
476 if (result
->opcode
== I_INCBIN
) {
478 * Correct syntax for INCBIN is that there should be
479 * one string operand, followed by one or two numeric
482 if (!result
->eops
|| result
->eops
->type
!= EOT_DB_STRING
)
483 error(ERR_NONFATAL
, "`incbin' expects a file name");
484 else if (result
->eops
->next
&&
485 result
->eops
->next
->type
!= EOT_DB_NUMBER
)
486 error(ERR_NONFATAL
, "`incbin': second parameter is",
488 else if (result
->eops
->next
&& result
->eops
->next
->next
&&
489 result
->eops
->next
->next
->type
!= EOT_DB_NUMBER
)
490 error(ERR_NONFATAL
, "`incbin': third parameter is",
492 else if (result
->eops
->next
&& result
->eops
->next
->next
&&
493 result
->eops
->next
->next
->next
)
495 "`incbin': more than three parameters");
499 * If we reach here, one of the above errors happened.
500 * Throw the instruction away.
504 } else /* DB ... */ if (oper_num
== 0)
505 error(ERR_WARNING
| ERR_PASS1
,
506 "no operand for data declaration");
508 result
->operands
= oper_num
;
513 /* right. Now we begin to parse the operands. There may be up to four
514 * of these, separated by commas, and terminated by a zero token. */
516 for (operand
= 0; operand
< MAX_OPERANDS
; operand
++) {
517 expr
*value
; /* used most of the time */
518 int mref
; /* is this going to be a memory ref? */
519 int bracket
; /* is it a [] mref, or a & mref? */
522 result
->oprs
[operand
].disp_size
= 0; /* have to zero this whatever */
523 result
->oprs
[operand
].eaflags
= 0; /* and this */
524 result
->oprs
[operand
].opflags
= 0;
526 i
= stdscan(NULL
, &tokval
);
528 break; /* end of operands: get out of here */
529 else if (first
&& i
== ':') {
530 insn_is_label
= true;
534 result
->oprs
[operand
].type
= 0; /* so far, no override */
535 while (i
== TOKEN_SPECIAL
) { /* size specifiers */
536 switch ((int)tokval
.t_integer
) {
538 if (!setsize
) /* we want to use only the first */
539 result
->oprs
[operand
].type
|= BITS8
;
544 result
->oprs
[operand
].type
|= BITS16
;
550 result
->oprs
[operand
].type
|= BITS32
;
555 result
->oprs
[operand
].type
|= BITS64
;
560 result
->oprs
[operand
].type
|= BITS80
;
565 result
->oprs
[operand
].type
|= BITS128
;
570 result
->oprs
[operand
].type
|= BITS256
;
574 result
->oprs
[operand
].type
|= TO
;
577 result
->oprs
[operand
].type
|= STRICT
;
580 result
->oprs
[operand
].type
|= FAR
;
583 result
->oprs
[operand
].type
|= NEAR
;
586 result
->oprs
[operand
].type
|= SHORT
;
589 error(ERR_NONFATAL
, "invalid operand size specification");
591 i
= stdscan(NULL
, &tokval
);
594 if (i
== '[' || i
== '&') { /* memory reference */
596 bracket
= (i
== '[');
597 i
= stdscan(NULL
, &tokval
); /* then skip the colon */
598 while (i
== TOKEN_SPECIAL
|| i
== TOKEN_PREFIX
) {
599 process_size_override(result
, operand
);
600 i
= stdscan(NULL
, &tokval
);
602 } else { /* immediate operand, or register */
604 bracket
= false; /* placate optimisers */
607 if ((result
->oprs
[operand
].type
& FAR
) && !mref
&&
608 result
->opcode
!= I_JMP
&& result
->opcode
!= I_CALL
) {
609 error(ERR_NONFATAL
, "invalid use of FAR operand specifier");
612 value
= evaluate(stdscan
, NULL
, &tokval
,
613 &result
->oprs
[operand
].opflags
,
614 critical
, error
, &hints
);
616 if (result
->oprs
[operand
].opflags
& OPFLAG_FORWARD
) {
617 result
->forw_ref
= true;
619 if (!value
) { /* error in evaluator */
620 result
->opcode
= -1; /* unrecoverable parse error: */
621 return result
; /* ignore this instruction */
623 if (i
== ':' && mref
) { /* it was seg:offset */
625 * Process the segment override.
627 if (value
[1].type
!= 0 || value
->value
!= 1 ||
628 REG_SREG
& ~nasm_reg_flags
[value
->type
])
629 error(ERR_NONFATAL
, "invalid segment override");
630 else if (result
->prefixes
[PPS_SEG
])
632 "instruction has conflicting segment overrides");
634 result
->prefixes
[PPS_SEG
] = value
->type
;
635 if (!(REG_FSGS
& ~nasm_reg_flags
[value
->type
]))
636 result
->oprs
[operand
].eaflags
|= EAF_FSGS
;
639 i
= stdscan(NULL
, &tokval
); /* then skip the colon */
640 while (i
== TOKEN_SPECIAL
|| i
== TOKEN_PREFIX
) {
641 process_size_override(result
, operand
);
642 i
= stdscan(NULL
, &tokval
);
644 value
= evaluate(stdscan
, NULL
, &tokval
,
645 &result
->oprs
[operand
].opflags
,
646 critical
, error
, &hints
);
648 if (result
->oprs
[operand
].opflags
& OPFLAG_FORWARD
) {
649 result
->forw_ref
= true;
651 /* and get the offset */
652 if (!value
) { /* but, error in evaluator */
653 result
->opcode
= -1; /* unrecoverable parse error: */
654 return result
; /* ignore this instruction */
657 if (mref
&& bracket
) { /* find ] at the end */
659 error(ERR_NONFATAL
, "parser: expecting ]");
660 do { /* error recovery again */
661 i
= stdscan(NULL
, &tokval
);
662 } while (i
!= 0 && i
!= ',');
663 } else /* we got the required ] */
664 i
= stdscan(NULL
, &tokval
);
665 } else { /* immediate operand */
666 if (i
!= 0 && i
!= ',' && i
!= ':') {
667 error(ERR_NONFATAL
, "comma or end of line expected");
668 do { /* error recovery */
669 i
= stdscan(NULL
, &tokval
);
670 } while (i
!= 0 && i
!= ',');
671 } else if (i
== ':') {
672 result
->oprs
[operand
].type
|= COLON
;
676 /* now convert the exprs returned from evaluate() into operand
679 if (mref
) { /* it's a memory reference */
681 int b
, i
, s
; /* basereg, indexreg, scale */
682 int64_t o
; /* offset */
684 b
= i
= -1, o
= s
= 0;
685 result
->oprs
[operand
].hintbase
= hints
.base
;
686 result
->oprs
[operand
].hinttype
= hints
.type
;
688 if (e
->type
&& e
->type
<= EXPR_REG_END
) { /* this bit's a register */
689 if (e
->value
== 1) /* in fact it can be basereg */
691 else /* no, it has to be indexreg */
692 i
= e
->type
, s
= e
->value
;
695 if (e
->type
&& e
->type
<= EXPR_REG_END
) { /* it's a 2nd register */
696 if (b
!= -1) /* If the first was the base, ... */
697 i
= e
->type
, s
= e
->value
; /* second has to be indexreg */
699 else if (e
->value
!= 1) { /* If both want to be index */
701 "beroset-p-592-invalid effective address");
708 if (e
->type
!= 0) { /* is there an offset? */
709 if (e
->type
<= EXPR_REG_END
) { /* in fact, is there an error? */
711 "beroset-p-603-invalid effective address");
715 if (e
->type
== EXPR_UNKNOWN
) {
716 o
= 0; /* doesn't matter what */
717 result
->oprs
[operand
].wrt
= NO_SEG
; /* nor this */
718 result
->oprs
[operand
].segment
= NO_SEG
; /* or this */
720 e
++; /* go to the end of the line */
722 if (e
->type
== EXPR_SIMPLE
) {
726 if (e
->type
== EXPR_WRT
) {
727 result
->oprs
[operand
].wrt
= e
->value
;
730 result
->oprs
[operand
].wrt
= NO_SEG
;
732 * Look for a segment base type.
734 if (e
->type
&& e
->type
< EXPR_SEGBASE
) {
736 "beroset-p-630-invalid effective address");
740 while (e
->type
&& e
->value
== 0)
742 if (e
->type
&& e
->value
!= 1) {
744 "beroset-p-637-invalid effective address");
749 result
->oprs
[operand
].segment
=
750 e
->type
- EXPR_SEGBASE
;
753 result
->oprs
[operand
].segment
= NO_SEG
;
754 while (e
->type
&& e
->value
== 0)
758 "beroset-p-650-invalid effective address");
766 result
->oprs
[operand
].wrt
= NO_SEG
;
767 result
->oprs
[operand
].segment
= NO_SEG
;
770 if (e
->type
!= 0) { /* there'd better be nothing left! */
772 "beroset-p-663-invalid effective address");
777 /* It is memory, but it can match any r/m operand */
778 result
->oprs
[operand
].type
|= MEMORY_ANY
;
780 if (b
== -1 && (i
== -1 || s
== 0)) {
781 int is_rel
= globalbits
== 64 &&
782 !(result
->oprs
[operand
].eaflags
& EAF_ABS
) &&
784 !(result
->oprs
[operand
].eaflags
& EAF_FSGS
)) ||
785 (result
->oprs
[operand
].eaflags
& EAF_REL
));
787 result
->oprs
[operand
].type
|= is_rel
? IP_REL
: MEM_OFFS
;
789 result
->oprs
[operand
].basereg
= b
;
790 result
->oprs
[operand
].indexreg
= i
;
791 result
->oprs
[operand
].scale
= s
;
792 result
->oprs
[operand
].offset
= o
;
793 } else { /* it's not a memory reference */
795 if (is_just_unknown(value
)) { /* it's immediate but unknown */
796 result
->oprs
[operand
].type
|= IMMEDIATE
;
797 result
->oprs
[operand
].offset
= 0; /* don't care */
798 result
->oprs
[operand
].segment
= NO_SEG
; /* don't care again */
799 result
->oprs
[operand
].wrt
= NO_SEG
; /* still don't care */
800 } else if (is_reloc(value
)) { /* it's immediate */
801 result
->oprs
[operand
].type
|= IMMEDIATE
;
802 result
->oprs
[operand
].offset
= reloc_value(value
);
803 result
->oprs
[operand
].segment
= reloc_seg(value
);
804 result
->oprs
[operand
].wrt
= reloc_wrt(value
);
805 if (is_simple(value
)) {
806 if (reloc_value(value
) == 1)
807 result
->oprs
[operand
].type
|= UNITY
;
808 if (optimizing
>= 0 &&
809 !(result
->oprs
[operand
].type
& STRICT
)) {
810 int64_t v64
= reloc_value(value
);
811 int32_t v32
= (int32_t)v64
;
812 int16_t v16
= (int16_t)v32
;
814 if (v64
>= -128 && v64
<= 127)
815 result
->oprs
[operand
].type
|= SBYTE64
;
816 if (v32
>= -128 && v32
<= 127)
817 result
->oprs
[operand
].type
|= SBYTE32
;
818 if (v16
>= -128 && v16
<= 127)
819 result
->oprs
[operand
].type
|= SBYTE16
;
822 } else { /* it's a register */
825 if (value
->type
>= EXPR_SIMPLE
|| value
->value
!= 1) {
826 error(ERR_NONFATAL
, "invalid operand type");
832 * check that its only 1 register, not an expression...
834 for (i
= 1; value
[i
].type
; i
++)
835 if (value
[i
].value
) {
836 error(ERR_NONFATAL
, "invalid operand type");
841 /* clear overrides, except TO which applies to FPU regs */
842 if (result
->oprs
[operand
].type
& ~TO
) {
844 * we want to produce a warning iff the specified size
845 * is different from the register size
847 rs
= result
->oprs
[operand
].type
& SIZE_MASK
;
851 result
->oprs
[operand
].type
&= TO
;
852 result
->oprs
[operand
].type
|= REGISTER
;
853 result
->oprs
[operand
].type
|= nasm_reg_flags
[value
->type
];
854 result
->oprs
[operand
].basereg
= value
->type
;
856 if (rs
&& (result
->oprs
[operand
].type
& SIZE_MASK
) != rs
)
857 error(ERR_WARNING
| ERR_PASS1
,
858 "register size specification ignored");
863 result
->operands
= operand
; /* set operand count */
865 /* clear remaining operands */
866 while (operand
< MAX_OPERANDS
)
867 result
->oprs
[operand
++].type
= 0;
870 * Transform RESW, RESD, RESQ, REST, RESO, RESY into RESB.
872 switch (result
->opcode
) {
874 result
->opcode
= I_RESB
;
875 result
->oprs
[0].offset
*= 2;
878 result
->opcode
= I_RESB
;
879 result
->oprs
[0].offset
*= 4;
882 result
->opcode
= I_RESB
;
883 result
->oprs
[0].offset
*= 8;
886 result
->opcode
= I_RESB
;
887 result
->oprs
[0].offset
*= 10;
890 result
->opcode
= I_RESB
;
891 result
->oprs
[0].offset
*= 16;
894 result
->opcode
= I_RESB
;
895 result
->oprs
[0].offset
*= 32;
904 static int is_comma_next(void)
911 i
= stdscan(NULL
, &tv
);
913 return (i
== ',' || i
== ';' || !i
);
916 void cleanup_insn(insn
* i
)
922 i
->eops
= i
->eops
->next
;