[Nasm-bugs] [Bug 3392679] New: [Feature request] Macros whose content is listed verbatim (including comments) to listing file

noreply-nasm at dev.nasm.us noreply-nasm at dev.nasm.us
Mon Jun 8 12:20:00 PDT 2020


            Bug ID: 3392679
           Summary: [Feature request] Macros whose content is listed
                    verbatim (including comments) to listing file
           Product: NASM
           Version: unspecified
          Hardware: All
                OS: All
            Status: OPEN
          Severity: enhancement
          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: Unknown

I recently came upon a use case for wrapping some large functions in multi-line
macros, which are used once to emit their content at one or another point. I
implemented that in my ldosboot boot.asm [1]. The point of this is that I can
easily select where to invoke the mmacro, [2] without duplicating the same code
in two places.

There is a disadvantage to this, however: In the listing file (when the macro
is given without ".nolist") the expansion of the macro is listed without
comments, and with all whitespace sequences reduced to single blanks each. So
when using the listing file for debugging, one either has to read the part that
defines the mmacro (to get the full comments and indentation) or the part where
the mmacro is invoked (to get the opcodes which the code is assembled into).

This could be avoided by putting each such block into small include files
instead, but I don't like that solution much.

Therefore, I propose that the multi-line macro facility could be extended to
allow (optionally) for "verbatim listing" macros. This should result in the
listing with the actual opcodes also preserving the whitespace and comments. I
figure this is likely nontrivial, but I wanted to suggest it at least.

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