Author Topic: question about nasmx inc files  (Read 20473 times)

Offline nullptr

  • Jr. Member
  • *
  • Posts: 27
question about nasmx inc files
« on: October 10, 2013, 12:21:00 PM »
Hello,

I'm a bit confused. I'm not very experienced assembly coder. I have downloaded
nasmx and complied some samples from demos folder. They are working fine, but e.g.
demo6.asm is 64 bit and uses inc file form ..\inc\win32 directory. Are 32 bit inc
files matching to 64 bit apps?

And next question:
From where GoLink.exe takes kernel32.lib or user32.lib? Other linkers e.g.
link.exe requries to specify locations of them by includelib directive in file or
by cmd libpath, but they are provided with masm package.

Any ideas?
thanks in advance.

Offline Rob Neff

  • Forum Moderator
  • Full Member
  • *****
  • Posts: 429
  • Country: us
Re: question about nasmx inc files
« Reply #1 on: October 10, 2013, 03:23:40 PM »
Hello,

I'm a bit confused. I'm not very experienced assembly coder. I have downloaded
nasmx and complied some samples from demos folder. They are working fine, but e.g.
demo6.asm is 64 bit and uses inc file form ..\inc\win32 directory. Are 32 bit inc
files matching to 64 bit apps?

NASMX by design enables 32-bit and 64-bit programming for a multitude of operating systems.  Rather than maintaining two separate include files we detect the bit-ness specified on the command line via the "nasm -f" switch and create an appropriate environment.  The Win32 subdirectory name is simply a relic of years gone by and should not be mis-interpreted as 32-bit Windows only.

And next question:
From where GoLink.exe takes kernel32.lib or user32.lib? Other linkers e.g.
link.exe requries to specify locations of them by includelib directive in file or
by cmd libpath, but they are provided with masm package.

Any ideas?
thanks in advance.

GoLink doesn't need .lib files specified - only the .dll name.  It performs it's own internal lookup logic to match the name of the function being called in your source file to the appropriately named function exported from one of the .dll files provided on the command line.  If you look in the NASMX demos and edit a Makefile or .bat file you will see the command syntax used when calling GoLink.  You can then copy the file to your own project subdirectory and edit to suit your needs.

Check out the author's website for more detailed information: http://www.godevtool.com/

Offline nullptr

  • Jr. Member
  • *
  • Posts: 27
Re: question about nasmx inc files
« Reply #2 on: October 10, 2013, 09:20:27 PM »
Thanks for reply. I saw that batch files. That's why i was asking. I have more questions:

Is there an inc file which contains protos of WinAPIs procs or C procs? I don't want to write it again every time i start a new project.

Does your invoke works same as masm?

and how to use sturcts defined inside e.g. windows.inc?

Offline Rob Neff

  • Forum Moderator
  • Full Member
  • *****
  • Posts: 429
  • Country: us
Re: question about nasmx inc files
« Reply #3 on: October 10, 2013, 11:24:46 PM »
Is there an inc file which contains protos of WinAPIs procs or C procs? I don't want to write it again every time i start a new project.

Yep.  Look in the NASMX inc/win32 directory.  The default is windows.inc but that pulls in a ton of defines and stuff which your program probably won't use and make assembling source files much slower.  There are a lot of prototypes already done for you.  It is by no means 100% complete but they will go a very far way for your development.

Does your invoke works same as masm?

The concepts are very similar but obviously specific to nasm's capabilities and syntax.

and how to use sturcts defined inside e.g. windows.inc?

Keep on checking out those demos!  There are a few that show how to use the structs.  Also, you can examine many of the inc/win32 include files to see how it's implemented behind-the-scenes.

Offline nullptr

  • Jr. Member
  • *
  • Posts: 27
Re: question about nasmx inc files
« Reply #4 on: October 11, 2013, 03:56:56 AM »
Thanks for help and for providing nasmx.