Fix the handling of the STRICT keyword

This commit is contained in:
H. Peter Anvin 2002-05-22 20:45:09 +00:00
parent f1bbcf3160
commit 8c1da7b3ce
2 changed files with 17 additions and 2 deletions

View File

@ -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;

View File

@ -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