We are migrating the bug tracker to github Issues. This is now the preferred way to report NASM bugs.

Self-registration is disabled due to spam issue (mail gorcunov@gmail.com or hpa@zytor.com to create an account)

Bug 3392960 - If [list -] is in effect at the end of the input file, it is also in effect at the beginning of the input file until the first [list +]
Summary: If [list -] is in effect at the end of the input file, it is also in effect a...
Status: CLOSED FIXED
Alias: None
Product: NASM
Classification: Unclassified
Component: Assembler (show other bugs)
Version: 3.00.xx
Hardware: All All
: Medium normal
Assignee: nobody
URL:
Depends on:
Blocks:
 
Reported: 2025-09-26 01:17 PDT by E. C. Masloch
Modified: 2025-09-30 02:52 PDT (History)
5 users (show)

Obtained from: Built from git using configure
Generated by: Human
Bug category: Incorrect listing or map file output, Unexpected or confusing behavior
Observed for: Valid test code
Regression: No
Regression since:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description E. C. Masloch 2025-09-26 01:17:16 PDT
I assume this is to do with how NASM does multiple passes over the input and each pass processes the listing output. In any case, a [list -] status at the end of the input file is in effect at the beginning of the input file as well until the first explicit [list +]. This can be observed both with NASM v3.00 rc9 (2025-09-20) and NASM v2.16.02 rc2 (2023-10-12).

test$ cat test1.asm

db 26
%note listed
db 38
test$ ~/proj/nasmtest/rc/nasm test1.asm -l /dev/stderr
     1
     2 00000000 1A                      db 26
     3                                  %note listed
     3          ------------------       note: listed
     4 00000001 26                      db 38
test$ cat test2.asm

db 26
[list -]
%note not listed
db 38
test$ ~/proj/nasmtest/rc/nasm test2.asm -l /dev/stderr
     0          ------------------       note: not listed
test$ cat test3.asm

db 26
[list -]
%note not listed
db 38
[list +]
test$ ~/proj/nasmtest/rc/nasm test3.asm -l /dev/stderr
     1
     2 00000000 1A                      db 26
     3                                  [list -]
     3          ------------------       note: not listed
test$ cat test4.asm

%note listed
db 26
[list -]
%note not listed
db 38
[list +]
%note listed
db 42
[list -]
test$ ~/proj/nasmtest/rc/nasm test4.asm -l /dev/stderr
     0          ------------------       note: listed
     0          ------------------       note: not listed
     8                                  %note listed
     8          ------------------       note: listed
     9 00000002 2A                      db 42
    10                                  [list -]
test$
Comment 1 H. Peter Anvin 2025-09-29 21:50:53 PDT
Fix checked in, will be in 3.00rc17.
Comment 2 E. C. Masloch 2025-09-30 02:52:23 PDT
Yep, works now.