[Nasm-bugs] [Bug 3392826] New: NASM Listing address defect if [org VALUE] not zero

noreply-nasm at dev.nasm.us noreply-nasm at dev.nasm.us
Mon Dec 5 15:58:50 PST 2022


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

            Bug ID: 3392826
           Summary: NASM Listing address defect if [org VALUE] not zero
           Product: NASM
           Version: 2.15.xx
          Hardware: All
                OS: All
            Status: OPEN
          Severity: normal
          Priority: Medium
         Component: Assembler
          Assignee: nobody at nasm.us
          Reporter: erdogantan at singlix.com
                CC: chang.seok.bae at intel.com, gorcunov at gmail.com,
                    hpa at zytor.com, nasm-bugs at nasm.us
     Obtained from: Binary from nasm.us

Created attachment 411862
  --> https://bugzilla.nasm.us/attachment.cgi?id=411862&action=edit
Listing file for Retro DOS v4.0 kernel draft (MSDOS 5.0 MSDOS.SYS)

I am assemblign MSDOS 5.0 MSDOS.SYS as Retro DOS v4.0
I am mixing commented source code with reverseengineered (disassembled)
original MSDOS.SYS file

msdos5.s file contains DOSCODE and DOSDATA segments..
DOS code segment has origin at 3DD0h [ORG 3DD0h]
DOS data segment origin is 0

i have added two segment in one source file by using segment .text (DOSCODE)
and segment .data (DOSDATA) method as very simple. (OUTPUT file is direct
binary.)

command: nasm msdos5.s -l msdos5.txt -o MSDOS.SYS -Z error.txt

NASM has a defect (i am not sure if it is a BUG or not)

ORG is not added to addresses and pointers (datafields) on listing files.

For example: Offset A197h is seen as ofset A197h-3DD0h and pointer (variable,
daa field) is seen as file offset not as memory (origined) offset.  

So when i checking my new kernel file with oreiginal file (on disasemby page)
i can not compare addresses. (tehre ara ORG vaue differences between addresses)

I am adding MSDOS5.TXT file for if you would like to check it.

Current listing is useful when org is ZERO.. but causes extra problems while
searching error reason when org is not zero. (i can not understand 'word ptr'
or 'dword ptr' fields contain correct addresses becasue ORG is not recognized
in listing. When i check output binary file in a binary file editor i see org
is added to pointers.) 

Note: MSDOS kernel's code segment also contains data.. And dos kernel starts at
offset 3DD0h (MSDOS 5.0) or 3DE0h (MSDOS 6.21). These are org values of DOSCODE
segment. So listing must be started from 03DD0h .... --->

Regards...

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