Just downloaded NASM packages for Linux and Win32 platforms. Win32 archive has just nasmw.exe and no libraries. What libraries (lib include) should I use to make a complete win32 exe program? Are MASM libraries compatible with NASM?
Is there any better assembler to use both in Windows and Linux?
Posted on 2004-09-20 07:24:24 by Vaxon
Fasm works on both Linux and Windows with plenty of examples for both.
Posted on 2004-09-20 08:20:04 by Eóin
What libraries (lib include) should I use to make a complete win32 exe program?

If you use GoLink, you could link directly with respective dlls or there is a win32.lib to use with alink you could find here: http://asmjournal.freeservers.com/win32/

Is there any better assembler to use both in Windows and Linux?

Try Fasm: it is also free, opensource but simpler, quicker and smaller.

http://www.flatassembler.net
Posted on 2004-09-20 08:28:38 by pelaillo
Nasm can output files in OMF format. Therefore you don't need import libraries. You can define every import inside the source.
Posted on 2004-09-20 11:46:33 by Sephiroth3

Is there any better assembler to use both in Windows and Linux?


no! 8)

ancev
Posted on 2004-09-20 14:36:35 by ancev
with -twin32, you can link to normal conventional .libs (found in SDK), and mslink, creating minimal exes. otherwise, you could create raw PE binaries.
Posted on 2004-09-20 16:07:41 by Drocon


USE32

extern _ExitProcess@4
ExitProcess equ _ExitProcess@4

[segment .text]
[global _start]
_start:
int 3
xor eax, eax
call ExitProcess


build with:


nasmw -fbin xxx.asm
link /ENTRY:start /SUBSYSTEM:WINDOWS xxx.obj kernel32.lib


no @'s, use drocons way, ELiCZ does that in ELiASM i believe with his libs.

I've never used fasm in linux so I couldn't say, but ancev wrote ELF linker for tasm omf files it's on 29a7..ok bye.
Posted on 2004-09-20 19:38:28 by archphase
If you want to use NASM + ALINK, here's something for you... For my ncom32.bat, simply copy everything inbetween the header and footer. Then at the command line, type: ncom32 myasm
Leave off the .asm extension.

If you favor the makefile approach, I've cut and pasted a makefile of mine below the batch file listing.

Here's nmake, which I use for this makefile: http://spiff.tripnet.se/~iczelion/files/nmake15.exe

It's a self-extracting executable, which will extract a readme file and the nmake.exe. Put this sucker in your PATH and then when your in a directory that you have a makefile in, type: nmake

That's all there is to it.

------------ ncom32.bat -----------------

REM By Al Leitch
REM This batch file quickens the process of assembling and linking the source code
REM All you do is place this file in the same directory as the assembler and linker.
REM Make sure this directory is in the PATH
REM How to use:
REM For example:
REM NCOM32 HI
REM Or if you want to attach your own msdos stub:
REM NCOM32 HI STUB
REM DO NOT append .asm to it. Errors will result.

if "%2"=="" goto NoStub
goto AttachStub

:NoStub
nasmw -fobj %1.asm
alink -oPE %1.obj
patcher.exe
goto End

:AttachStub
alink -oPE %1.obj -stub %2.exe

:End

------------- end of ncom32.bat --------------


------------- makefile ----------------

myasm.exe: myasm.obj
alink -oPE myasm

myasm.obj: myasm.asm
nasmw -fobj myasm.asm

-------------- end of makefile -------------
Posted on 2004-09-25 16:38:10 by Al_Leitch
Here's a simple win32 hello world. win32n.inc: http://rs1.szif.hu/~tomcat/win32/win32n.zip

Compilation:
nasmw -fobj helloworld.asm
alink -oPE helloworld.obj

;--------------------

EXTERN ExitProcess
IMPORT ExitProcess kernel32.dll

EXTERN lstrlen
IMPORT lstrlen kernel32.dll

EXTERN MessageBoxA
IMPORT MessageBoxA user32.dll

;--------------------------

%include "win32n.inc"

;--------------------------




SECTION CODE USE32 CLASS=CODE
..start:

main_display_data:
push UINT MB_OK
push LPCTSTR Title
push LPCTSTR Content
push HWND 0
call

main_exit:
push DWORD 0
call

SECTION DATA USE32 CLASS=DATA

Title db "Al's proggy!", 0
Content db "Hello World!"
Posted on 2004-09-25 16:42:32 by Al_Leitch
- What libraries (lib include) should I use to make a complete win32
- exe program?

It depends what linker do you use. In win32 you may not use any
library. It is possible not use any linker.

- Are MASM libraries compatible with NASM?

Yes, but you need to link with MS linker and some tricks in your
source code: there are macros that you can use.
Posted on 2004-09-30 21:10:39 by n u M I T_o r
ALINK provides the option to use a library.

As far as the MASM libraries go, you know where the macros can be found :-)

- What libraries (lib include) should I use to make a complete win32
- exe program?

It depends what linker do you use. In win32 you may not use any
library. It is possible not use any linker.

- Are MASM libraries compatible with NASM?

Yes, but you need to link with MS linker and some tricks in your
source code: there are macros that you can use.
Posted on 2004-10-02 17:25:55 by Al_Leitch
In the files directory of the yahoo win32-nasm-users list you can find:

1. Macros to link a NASM project with the MS LINK

http://groups.yahoo.com/group/win32-nasm-users/files/PEMAC/madcros.zip
(Look at the wingui sample).

http://groups.yahoo.com/group/win32-nasm-users/files/nasm-VisualStudio-sample.zip


2. Macros to compile a NASM projecft without any linker

http://groups.yahoo.com/group/win32-nasm-users/files/PEMAC/NPEMAC_v0.1.zip
Posted on 2004-10-03 14:13:43 by n u M I T_o r
in the page of alink there is provided a library that you can use, is general.

Also you can use lcclnk.exe of lcc win32 compiler for link with those library.
Posted on 2004-10-03 15:44:07 by rea