NASM - The Netwide Assembler

NASM Forum => Using NASM => Topic started by: fullofbugs on February 11, 2021, 02:15:22 PM

Title: A bug in NASM 2.15
Post by: fullofbugs on February 11, 2021, 02:15:22 PM
I just updated to NASM 2.15 and am still fighting with the changes. I found a bug and want to share it with you before it is fixed. I already submitted a bug report.

Code: [Select]
%macro Convert  2-3.nolist   
  %[%3]CVTDQ2PD %1, %2
%endmacro

NASM will no generate any code if the last parameter is empty.

Code: [Select]
Convert XMM0, XMM1    Expected code: CVTDQ2PD XMM0, XMM1
    Generated code: empty

Code: [Select]
Convert XMM0, XMM1, {}    Expected code: CVTDQ2PD XMM0, XMM1
    Generated code: empty

Code: [Select]
Convert XMM0, XMM1, V    Expected code: VCVTDQ2PD XMM0, XMM1
    Generated code: VCVTDQ2PD XMM0, XMM1
Title: Re: A bug in NASM 2.15
Post by: fullofbugs on February 11, 2021, 02:49:54 PM
In most cases, it can be fixed by removing []
Code: [Select]
%macro Convert  2-3.nolist   
  %3CVTDQ2PD %1, %2
%endmacro

But it is quite confusing to read.