behavior in the x86 architecture.
svn path=/trunk/yasm/; revision=1679
retval->targetmod = 0;
retval->size = 0;
retval->deref = 0;
+ retval->strict = 0;
return retval;
}
retval->targetmod = 0;
retval->size = 0;
retval->deref = 0;
+ retval->strict = 0;
return retval;
}
retval->targetmod = 0;
retval->size = 0;
retval->deref = 0;
+ retval->strict = 0;
return retval;
}
retval->targetmod = 0;
retval->size = 0;
retval->deref = 0;
+ retval->strict = 0;
}
return retval;
}
fprintf(f, "%*sTargetMod=%lx\n", indent_level+1, "", op->targetmod);
fprintf(f, "%*sSize=%u\n", indent_level+1, "", op->size);
+ fprintf(f, "%*sDeref=%d, Strict=%d\n", indent_level+1, "", (int)op->deref,
+ (int)op->strict);
}
void
* to indicate the "*" prefix has been used, and the arch needs to adjust
* the operand type appropriately depending on the instruction type.
*/
- int deref;
+ int deref:1;
+
+ /** Nonzero if strict. Used for "strict foo" in NASM.
+ * This is used to inhibit optimization on otherwise "sized" values.
+ * For example, the user may just want to be explicit with the size on
+ * "push dword 4", but not actually want to force the immediate size to
+ * 4 bytes (rather wanting the optimizer to optimize it down to 1 byte as
+ * though "dword" was not specified). To indicate the immediate should
+ * actually be forced to 4 bytes, the user needs to write
+ * "push strict dword 4", which sets this flag.
+ */
+ int strict:1;
};
#endif
%token <int_info> DECLARE_DATA
%token <int_info> RESERVE_SPACE
%token INCBIN EQU TIMES
-%token SEG WRT NOSPLIT
+%token SEG WRT NOSPLIT STRICT
%token <arch_data> INSN PREFIX REG SEGREG TARGETMOD
%token LEFT_OP RIGHT_OP SIGNDIV SIGNMOD START_SECTION_ID
%token <str_val> ID LOCAL_ID SPECIAL_ID
operand: '[' memaddr ']' { $$ = yasm_operand_create_mem($2); }
| expr { $$ = yasm_operand_create_imm($1); }
| SEGREG { $$ = yasm_operand_create_segreg($1[0]); }
+ | STRICT operand { $$ = $2; $$->strict = 1; }
| SIZE_OVERRIDE operand {
$$ = $2;
if ($$->type == YASM_INSN__OPERAND_REG &&
'wrt' { RETURN(WRT); }
'nosplit' { RETURN(NOSPLIT); }
+ 'strict' { RETURN(STRICT); }
/* operators */
"<<" { RETURN(LEFT_OP); }