diff options
author | H. Peter Anvin <hpa@zytor.com> | 2002-05-22 20:45:09 +0000 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2002-05-22 20:45:09 +0000 |
commit | 8c1da7b3cea0acbf138bd0f984cf4d14d94f69a1 (patch) | |
tree | ec5fb2331ba6b55fbc5a9a6b8cb8b15caece62c5 | |
parent | f1bbcf31600a0a691f9454803985a45eb4d4fd25 (diff) | |
download | nasm-8c1da7b3cea0acbf138bd0f984cf4d14d94f69a1.tar.gz |
Fix the handling of the STRICT keyword
-rw-r--r-- | parser.c | 3 | ||||
-rw-r--r-- | test/expimp.asm | 16 |
2 files changed, 17 insertions, 2 deletions
@@ -690,7 +690,8 @@ insn *parse_line (int pass, char *buffer, insn *result, if (is_simple(value)) { if (reloc_value(value)==1) result->oprs[operand].type |= UNITY; - if (optimizing>=0) { + if (optimizing>=0 && + !(result->oprs[operand].type & STRICT)) { if (reloc_value(value) >= -128 && reloc_value(value) <= 127) result->oprs[operand].type |= SBYTE; diff --git a/test/expimp.asm b/test/expimp.asm index 90d9aedc..117b8549 100644 --- a/test/expimp.asm +++ b/test/expimp.asm @@ -1,7 +1,6 @@ ; ; Test of explicitly and implicitly sized operands ; -start: add esi,2 ; Implicit add esi,123456h ; Implicit add esi,byte 2 ; Explicit @@ -15,9 +14,24 @@ start: add esi,strict dword 2 ; Explicit Strict add esi,strict dword 123456h ; Explicit Strict add esi,strict byte 123456h ; Explicit Strict Truncation + + add eax,2 ; Implicit + add eax,123456h ; Implicit + add eax,byte 2 ; Explicit + add eax,dword 2 ; Explicit + add eax,dword 123456h ; Explicit + add eax,byte 123456h ; Explicit Truncation + + add eax,strict 2 ; Implicit Strict + add eax,strict 123456h ; Implicit Strict + add eax,strict byte 2 ; Explicit Strict + add eax,strict dword 2 ; Explicit Strict + add eax,strict dword 123456h ; Explicit Strict + add eax,strict byte 123456h ; Explicit Strict Truncation ; ; Same thing with branches ; +start: jmp short start ; Explicit jmp near start ; Explicit jmp word start ; Explicit |