[Nasm-bugs] [Bug 3392747] New: git nasm: bitshift left by 1 (<< 1) in %assign appears to shift right

noreply-nasm at dev.nasm.us noreply-nasm at dev.nasm.us
Wed Mar 24 12:53:16 PDT 2021


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

            Bug ID: 3392747
           Summary: git nasm: bitshift left by 1 (<< 1) in %assign appears
                    to shift right
           Product: NASM
           Version: 2.16 (development)
          Hardware: All
                OS: All
            Status: OPEN
          Severity: critical
          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: Built from git using configure

$ (cd ~/proj/nasm/; git describe)
nasm-2.15.05-118-g5368e457
$ newnasm -v
NASM version 2.16rc0 compiled on Mar 24 2021
$ cat test2.asm

%idefine words(b)       ((b)+1>>1)
%idefine fromwords(w)           ((w)<<1)

LOADCMDLINE_size equ 256
%assign ll fromwords(words(LOADCMDLINE_size))
%assign mm LOADCMDLINE_size
%assign nn (words(LOADCMDLINE_size))
%assign oo fromwords(nn)

dw ll           ; expected 0100h
dw mm           ; expected 0100h
dw nn           ; expected 0080h
dw oo           ; expected 0100h
$ newnasm test2.asm -l /dev/stderr
     1
     2                                  %idefine words(b)       ((b)+1>>1)
     3                                  %idefine fromwords(w)          
((w)<<1)
     4
     5                                  LOADCMDLINE_size equ 256
     6                                  %assign ll
fromwords(words(LOADCMDLINE_size))
     7                                  %assign mm LOADCMDLINE_size
     8                                  %assign nn (words(LOADCMDLINE_size))
     9                                  %assign oo fromwords(nn)
    10
    11 00000000 4000                    dw ll           ; expected 0100h
    12 00000002 0001                    dw mm           ; expected 0100h
    13 00000004 8000                    dw nn           ; expected 0080h
    14 00000006 4000                    dw oo           ; expected 0100h
$

-- 
You are receiving this mail because:
You are watching all bug changes.
You are on the CC list for the bug.


More information about the Nasm-bugs mailing list