assemblyfasm

error else import32.inc with find files with FASM version 1.73.32


I try to find files with fasm version 1.73.32 , the source code can be found at this paste source code.

The error comes with : Unexpected instruction 'else' at line 99.

Any idea why this not work ?

See this :

import kernel32,\
       GetModuleHandle,'GetModuleHandleA',\
       ExitProcess,'ExitProcess',\
       FindFirstFile,'FindFirstFileA',\
       FindNextFile,'FindNextFileA',\
       FindClose,'FindClose' 

... into import32.inc is this else at:

macro import name,[label,string]
 { common
    rb (- rva $) and 3
    if defined name#.referred
     name#.lookup:
   forward
     if used label
      if string eqtype ''
       local _label
       dd RVA _label
      else  ...
enter code here

Solution

  • The error message is a red herring. The problem is that including win32a.inc defines a macro called directory which conflicts with your use of proc GetFileList, directory, buffer. Rename your argument or purge the macro if you don't need it.

    PS: Fixing that I get other errors. If you can't get it to work, post separate question about those.