When using "-f win32" it doesn't recognize the IMPORT statement for importing a DLL function. The following code, for example, does not compile when using "-f win32" or "-f coff", and instead gives the error "error: parser: instruction expected".
IMPORT MessageBoxA user32.dll
EXTERN MessageBoxA
GLOBAL start
section .data USE32
Text: db "This is a test.",0
section .text USE32
start:
push 0
push 0
push Text
push 0
call [MessageBoxA]
ret
But it does compile when using "-f obj". But that introduces its own problem. It's an older standard of object file known as OMF. All proper 32bit Windows compilers use COFF standard (which is what is used with "-f win32" or "-f coff"). While alink.exe will work with OMF type object files, not all linkers will (such as the other popular freeware linker known as GoLink). NASM developers, please fix this bug, and support the IMPORT statement with "-f win32".