summaryrefslogtreecommitdiff
path: root/nasm.c
diff options
context:
space:
mode:
authorJin Kyu Song <jin.kyu.song@intel.com>2013-12-04 20:05:55 -0800
committerJin Kyu Song <jin.kyu.song@intel.com>2013-12-04 20:10:08 -0800
commitb287ff0ddbfb997663ca9432ca3456e3d15ae9ed (patch)
tree2b5e8c2f5830eedc53b61458137a1f69a296bb0f /nasm.c
parentbb8cf3fa77e63f7c6a02d23bbfe3426beff26358 (diff)
downloadnasm-b287ff0ddbfb997663ca9432ca3456e3d15ae9ed.tar.gz
nasm-b287ff0ddbfb997663ca9432ca3456e3d15ae9ed.tar.bz2
nasm-b287ff0ddbfb997663ca9432ca3456e3d15ae9ed.zip
bnd: Add a new nobnd prefix
bnd and nobnd prifixes can be used for each instruction line to direct whether bnd registers should be preserved or not. And those are also added as options for DEFAULT directive. Once bnd is set with default, DEFAULT BND, all bnd-prefix available instructions are prefixed with bnd. To override it, nobnd prefix can be used. In the other way, DEFAULT NOBND can disable DEFAULT BND and have nasm encode in the normal way. Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
Diffstat (limited to 'nasm.c')
-rw-r--r--nasm.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/nasm.c b/nasm.c
index d10ddbc..2bb3029 100644
--- a/nasm.c
+++ b/nasm.c
@@ -89,6 +89,7 @@ bool tasm_compatible_mode = false;
int pass0, passn;
int maxbits = 0;
int globalrel = 0;
+int globalbnd = 0;
static time_t official_compile_time;
@@ -1525,7 +1526,7 @@ static void assemble_file(char *fname, StrList **depend_ptr)
stdscan_reset();
stdscan_set(value);
tokval.t_type = TOKEN_INVALID;
- if (stdscan(NULL, &tokval) == TOKEN_SPECIAL) {
+ if (stdscan(NULL, &tokval) != TOKEN_INVALID) {
switch ((int)tokval.t_integer) {
case S_REL:
globalrel = 1;
@@ -1533,6 +1534,12 @@ static void assemble_file(char *fname, StrList **depend_ptr)
case S_ABS:
globalrel = 0;
break;
+ case P_BND:
+ globalbnd = 1;
+ break;
+ case P_NOBND:
+ globalbnd = 0;
+ break;
default:
err = 1;
break;