[Nasm-bugs] [Bug 3392467] New: use short immediate opcode when available

no-reply at bugzilla-nasm.gorcunov.org no-reply at bugzilla-nasm.gorcunov.org
Fri Feb 23 12:26:11 PST 2018


            Bug ID: 3392467
           Summary: use short immediate opcode when available
           Product: NASM
           Version: 2.12.xx
          Hardware: All
                OS: Linux
            Status: OPEN
          Severity: normal
          Priority: Medium
         Component: Assembler
          Assignee: nobody at nasm.us
          Reporter: negge at dgql.org
                CC: gorcunov at gmail.com, hpa at zytor.com, nasm-bugs at nasm.us
     Obtained from: From OS distribution

Created attachment 411626
  --> https://bugzilla.nasm.us/attachment.cgi?id=411626&action=edit

Some opcodes allow byte immediate's when they value is -128 to 127.  However,
if that value is defined with arithmetic, the assembler picks the larger size. 
See the following example:

$ cat nasm_bug.asm     
  bits 16
  org 0x100
segment .text
  jmp @end_data
  val1: dw 0x1234
  fild word [si + 0x2]
  fild word [si + val1 - 0x100]

$ ndisasm -b16 nasm_bug.com
00000000  EB02              jmp short 0x4
00000002  3412              xor al,0x12
00000004  DF4402            fild word [si+0x2]
00000007  DF840200          fild word [si+0x2]
0000000B  C3                ret

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