mirror of
https://github.com/netwide-assembler/nasm.git
synced 2025-01-18 16:25:05 +08:00
Fix the handling of the STRICT keyword
This commit is contained in:
parent
f1bbcf3160
commit
8c1da7b3ce
3
parser.c
3
parser.c
@ -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;
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user