NASM - The Netwide Assembler

NASM Forum => Using NASM => Topic started by: nobody on June 08, 2009, 03:29:53 PM

Title: Instruction Expected for AVX / FMA Instrcns.
Post by: nobody on June 08, 2009, 03:29:53 PM
Whenever I try to assemble any VEX or FMA instructions, I get the error "Instruction expected".

I've tried simple instructions like AND, ADD, etc. and they seem to work fine.

Is there some flag I need to set to enable nasm to accept these more recent instructions?

Thanks
Title: Re: Instruction Expected for AVX / FMA Instrcns.
Post by: nobody on June 08, 2009, 03:41:08 PM
OP Here

Sometimes for certain instructions it also gives the "Symbol ... redefined" error


Here is my input file:---------------------------

? 1 cvtsi2sd xmm1,[eax]
  2 cvtsi2sd xmm1,dword [eax]
  3 cvtsi2sd xmm1,qword [eax]
  4
  5 cvtsi2sd xmm1,[rax]
  6 cvtsi2sd xmm1,dword [rax]
  7 cvtsi2sd xmm1,qword [rax]
  8
  9 ;********************************************#
 10
 11 vcvtsi2sd xmm1,xmm2,  [eax]
 12 vcvtsi2sd xmm1,xmm2,dword [eax]
 13 vcvtsi2sd xmm1,xmm2,qword [eax]
 14
 15 vcvtsi2sd xmm1,xmm2,  [rax]
 16 vcvtsi2sd xmm1,xmm2,dword [rax]
 17 vcvtsi2sd xmm1,xmm2,qword [rax]
 18
----------------------------------------------------


This is my output from nasm:----------------------------

?in3.s:11: error: parser: instruction expected
in3.s:12: error: symbol `vcvtsi2sd' redefined
in3.s:12: error: parser: instruction expected
in3.s:13: error: symbol `vcvtsi2sd' redefined
in3.s:13: error: parser: instruction expected
in3.s:15: error: symbol `vcvtsi2sd' redefined
in3.s:15: error: parser: instruction expected
in3.s:16: error: symbol `vcvtsi2sd' redefined
in3.s:16: error: parser: instruction expected
in3.s:17: error: symbol `vcvtsi2sd' redefined
in3.s:17: error: parser: instruction expected



----------------------------------------------------------
Title: Re: Instruction Expected for AVX / FMA Instrcns.
Post by: Frank Kotler on June 08, 2009, 05:39:46 PM
What output format are you using? Nasm will only recognize those instructions in "-f elf64", "-f win64", or with "bits 64" specified in "-f bin". Wouldn't it be nice if it were as simple as that? :)

I'm actually getting different error messages than you show... Latest Nasm, if it should make a difference, at http://www.nasm.us (http://www.nasm.us)

Best,
Frank
Title: Re: Instruction Expected for AVX / FMA Instrcns.
Post by: nobody on June 08, 2009, 06:35:34 PM
I have the latest version of nasm (2.06rc12), but I can't use -f elf64 or -f win 64.

When I try it, it says
nasm: fatal: unrecognised output format `elf64' - use -hf for a list

nasm -hf gives the following list of modes:
valid output formats for -f are (`*' denotes default):
  * bin       flat-form binary files (e.g. DOS .COM, .SYS)
    aout      Linux a.out object files
    aoutb     NetBSD/FreeBSD a.out object files
    coff      COFF (i386) object files (e.g. DJGPP for DOS)
    elf       ELF32 (i386) object files (e.g. Linux)
    as86      Linux as86 (bin86 version 0.3) object files
    obj       MS-DOS 16-bit/32-bit OMF object files
    win32     Microsoft Win32 (i386) object files
    rdf       Relocatable Dynamic Object File Format v2.0
    ieee      IEEE-695 (LADsoft variant) object file format

I don't see any 64-bit modes.
I tried deleting and remaking nasm, but that didn't change anything.

It seems like an old version of nasm, but it's not.....

Is there something I'm missing?

Thanks,
John (OP)