[Nasm-bugs] [Bug 3392827] New: 'pops' bug for example: pops ds makes an opcode 3Eh instead of giving syntax error about 'pop' inst.

noreply-nasm at dev.nasm.us noreply-nasm at dev.nasm.us
Sun Dec 25 07:36:42 PST 2022


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

            Bug ID: 3392827
           Summary: 'pops' bug for example: pops ds makes an opcode 3Eh
                    instead of giving syntax error about 'pop' inst.
           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

When I was writing 
push cs
pop ds

opcode: 0Eh, 1Fh respectievly

mistakenly i have written

push cs   - 0Eh
pops ds   - 3Eh !!! 

NASM puts 3Eh opcode instead of 1Fh for pops ds)

Correct response from assembler would be 'syntax error' message to user
(stderr) with line number of 'pops ds' wrong instruction.

NASM (v2.15) doesnt give error message for that...
command:
nasm iosys5.s -l iosys5.txt -o IO.SYS -Z error.txt
(16 bit code.)

error.txt is empty... (so, we know/think binary/output file is ready to use)

Listing: (IO.SYS loader section)

  553 000000DD 817F035250         cmp   word [bx+3], 'RP' ; 'RPL'
  554 000000E2 750F               jnz   short Skip_RPL
  555 000000E4 807F054C           cmp   byte [bx+5], 'L'
  556 000000E8 7509               jnz   short Skip_RPL
  557 000000EA 89C2               mov   dx, ax  ; get TOM into DX
  558 000000EC B8064A             mov   ax, 4A06h
  559 000000EF CD2F               int   2Fh     ; Get new TOM from any RPL
  560 000000F1 89D0               mov   ax, dx
  561                    Skip_RPL:
  562                            ; 24/12/2022
  563 000000F3 0E                 push  cs
  564 000000F4 3E                 pops  ds   ; wrong! it would be 'pop ds'
  565                                  
  566 000000F5 B104               mov   cl, 4
  567 000000F7 8B16[1200]         mov   dx, [BytesPerSec] ; 24/12/2022
  568                             ;mov  dx, [cs:BytesPerSec]
  569 000000FB D3EA               shr   dx, cl

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