[Nasm-bugs] [Bug 3392655] New: "mov al, var" does not cause warning when "var" evaluates to 7C10h (in-section offset 10h within org 7C00h section)

noreply-nasm at dev.nasm.us noreply-nasm at dev.nasm.us
Tue Mar 31 08:28:35 PDT 2020


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

            Bug ID: 3392655
           Summary: "mov al, var" does not cause warning when "var"
                    evaluates to 7C10h (in-section offset 10h within org
                    7C00h section)
           Product: NASM
           Version: 2.15 (development)
          Hardware: All
                OS: All
            Status: OPEN
          Severity: normal
          Priority: Medium
         Component: Assembler
          Assignee: nobody at nasm.us
          Reporter: pushbx at ulukai.org
                CC: chang.seok.bae at intel.com, gorcunov at gmail.com,
                    hpa at zytor.com, nasm-bugs at nasm.us
     Obtained from: Built from git using configure

Here's the test case. Note that (first bug) the movs with destination al and
sil do not warn when the in-section offset is 0 or 16, even though the
relocated value is 7C00h or 7C10h. When the in-section offset is 256 (relocated
to 7D00h) then git nasm does not warn either (second bug), but nasm 2.12.02
does warn "byte value exceeds bounds" for these cases as expected.

$ cat test.asm
[map all test.map]

        bits BITS
        org 7C00h

start:

mov al, var
%if BITS == 64
mov sil, var
%endif

mov al, foo
%if BITS == 64
mov sil, foo
%endif

mov al, start
%if BITS == 64
mov sil, start
%endif

        align 16
var:    db 0

        align 256
foo:    db 0
$ grep -nE '' test.asm
1:[map all test.map]
2:
3:      bits BITS
4:      org 7C00h
5:
6:start:
7:
8:mov al, var
9:%if BITS == 64
10:mov sil, var
11:%endif
12:
13:mov al, foo
14:%if BITS == 64
15:mov sil, foo
16:%endif
17:
18:mov al, start
19:%if BITS == 64
20:mov sil, start
21:%endif
22:
23:     align 16
24:var: db 0
25:
26:     align 256
27:foo: db 0
$ for bits in 16 32 64; do for nasm in nasm oldnasm; do echo "nasm=$nasm
bits=$bits"; $nasm -v && $nasm -W+all test.asm -l test.lst -o test.bin -D
BITS=$bits; done; done
nasm=nasm bits=16
NASM version 2.15rc0 compiled on Nov 22 2019
nasm=oldnasm bits=16
NASM version 2.12.02 compiled on Aug 10 2019
test.asm:13: warning: byte value exceeds bounds
nasm=nasm bits=32
NASM version 2.15rc0 compiled on Nov 22 2019
nasm=oldnasm bits=32
NASM version 2.12.02 compiled on Aug 10 2019
test.asm:13: warning: byte value exceeds bounds
nasm=nasm bits=64
NASM version 2.15rc0 compiled on Nov 22 2019
nasm=oldnasm bits=64
NASM version 2.12.02 compiled on Aug 10 2019
test.asm:13: warning: byte value exceeds bounds
test.asm:15: warning: byte value exceeds bounds
$

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