[Nasm-bugs] [Bug 3392472] New: spurious "word data exceeds bounds" if (16-bit) near jump displacement has bit 8000h set

no-reply at bugzilla-nasm.gorcunov.org no-reply at bugzilla-nasm.gorcunov.org
Wed Mar 7 05:33:36 PST 2018


https://bugzilla.nasm.us/show_bug.cgi?id=3392472

            Bug ID: 3392472
           Summary: spurious "word data exceeds bounds" if (16-bit) near
                    jump displacement has bit 8000h set
           Product: NASM
           Version: 2.13.xx
          Hardware: All
                OS: All
            Status: OPEN
          Severity: minor
          Priority: Medium
         Component: Assembler
          Assignee: nobody at nasm.us
          Reporter: pushbx at 38.de
                CC: gorcunov at gmail.com, hpa at zytor.com, nasm-bugs at nasm.us
     Obtained from: Binary from nasm.us

Created attachment 411631
  --> https://bugzilla.nasm.us/attachment.cgi?id=411631&action=edit
test.asm as shown in the log

$ cat test.asm
org 0
%ifndef SEEK
 %define SEEK 0
%endif
times SEEK - ($ - $$) nop
jmp near init

%ifndef NUM
 %define NUM 9956h
%endif
times NUM - ($ - $$) db 0
init:
$ nasm -v
NASM version 2.13.03 compiled on Feb  7 2018
$ nasm -l test.lst -o test.bin test.asm
test.asm:6: warning: word data exceeds bounds [-w+number-overflow]
$ cat test.lst
     1                                  org 0
     2                                  %ifndef SEEK
     3                                   %define SEEK 0
     4                                  %endif
     5                                  times SEEK - ($ - $$) nop
     6 00000000 E95399                  jmp near init
     6          ******************       warning: word data exceeds bounds
[-w+number-overflow]
     7                                  
     8                                  %ifndef NUM
     9                                   %define NUM 9956h
    10                                  %endif
    11 00000003 00<rept>                times NUM - ($ - $$) db 0
    12                                  init:
$ cat test.bin | od -Ax -tx1z
000000 e9 53 99 00 00 00 00 00 00 00 00 00 00 00 00 00  >.S..............<
000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  >................<
*
009950 00 00 00 00 00 00                                >......<
009956
$ nasm -DNUM=8002h -l test.lst -o test.bin test.asm
$ nasm -DNUM=8003h -l test.lst -o test.bin test.asm
test.asm:6: warning: word data exceeds bounds [-w+number-overflow]
$ nasm -DNUM=8003h -DSEEK=1 -l test.lst -o test.bin test.asm
$ nasm -DNUM=8004h -DSEEK=1 -l test.lst -o test.bin test.asm
test.asm:6: warning: word data exceeds bounds [-w+number-overflow]
$ cat test.lst
     1                                  org 0
     2                                  %ifndef SEEK
     3                                   %define SEEK 0
     4                                  %endif
     5 00000000 90                      times SEEK - ($ - $$) nop
     6 00000001 E90080                  jmp near init
     6          ******************       warning: word data exceeds bounds
[-w+number-overflow]
     7                                  
     8                                  %ifndef NUM
     9                                   %define NUM 9956h
    10                                  %endif
    11 00000004 00<rept>                times NUM - ($ - $$) db 0
    12                                  init:
$

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are watching all bug changes.


More information about the Nasm-bugs mailing list