summaryrefslogtreecommitdiff
path: root/assemble.c
diff options
context:
space:
mode:
authorCharles Crayne <chuck@thor.crayne.org>2008-09-30 16:11:32 -0700
committerCharles Crayne <chuck@thor.crayne.org>2008-09-30 16:11:32 -0700
commitf1aefd8456b0d32d36a283cc6d12b3a09ae8fdb5 (patch)
tree094c3c6d4bb022de0cd56be0c407295a7fd375cf /assemble.c
parent3cc245994427cb7f22577c5a343fe4ea581991a5 (diff)
downloadnasm-f1aefd8456b0d32d36a283cc6d12b3a09ae8fdb5.tar.gz
nasm-f1aefd8456b0d32d36a283cc6d12b3a09ae8fdb5.tar.bz2
nasm-f1aefd8456b0d32d36a283cc6d12b3a09ae8fdb5.zip
Change behavior of -O0 and -O1 for backward compatibility
-O0: JMP default to NEAR, Jcc/LOOP/JCXZ default to SHORT. In other words, this is reverting to full-blown 0.98 behavior, not 0.98.39. -O1: JMP and Jcc default to NEAR, LOOP/JCXZ default to SHORT (only possible form).
Diffstat (limited to 'assemble.c')
-rw-r--r--assemble.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/assemble.c b/assemble.c
index 16c8861..9d23240 100644
--- a/assemble.c
+++ b/assemble.c
@@ -247,9 +247,13 @@ static int jmp_match(int32_t segment, int64_t offset, int bits,
int64_t isize;
uint8_t c = code[0];
- if (c != 0370 && c != 0371)
+ if ((c != 0370 && c != 0371) || (ins->oprs[0].type & STRICT))
return 0;
- if ((optimizing <= 0 || (ins->oprs[0].type & STRICT)))
+ if (optimizing == 0)
+ {
+ return 0;
+ }
+ if (optimizing < 0 && c == 0371 )
{
return 0;
}