Author Topic: Beginner Problem  (Read 10337 times)

Offline Mittens

  • Jr. Member
  • *
  • Posts: 2
Beginner Problem
« on: December 02, 2010, 03:41:47 AM »
Just tried writing my first simple assembly program today, but when I try to compile "nasm -fbin hello.asm -o hello.com"
I get this error message:
"This version of C:\Users....\nasm.exe is not compatible with the version of Windows you're running. Check you're computer's system information to see whether you need a x86 (32-bit) or x64 (64-bit) version of the program, and then contact the software publisher."

Will it not compile on Windows 7 64-bit? Is there any way around this?

Thanks.

Offline Frank Kotler

  • NASM Developer
  • Hero Member
  • *****
  • Posts: 2667
  • Country: us
Re: Beginner Problem
« Reply #1 on: December 02, 2010, 05:23:44 AM »
Hmmm... interesting question! AFAIK, a 32-bit Windows build of Nasm should run without problem on a 64-bit system. What would not run on such a system would be the 32-bit extended dos (DJGPP) version, while it should run fine on a 32-bit Windows system. ("long mode" doesn't support VM86 mode, which DJGPP requires) Obviously(?), Nasm built for Linux, BSD, MacOSX, etc. wouldn't run either. (but wouldn't be named ".exe")

Typing "nasm -v" will divulge what version of Nasm you've got (and when it was compiled), but I don't think there's any easy way to determine what build you've got. Examining the first few bytes of the executable file (a "hex editor" would be good, but you can see it in a plain text editor) will show "7F E L F" for Linux, etc. Both Windows and DJGPP would show "MZ" as the first two bytes - the Windows build would show "PE" at offset 80h(?), while the DJGPP build has some text about the "dos stub"...

The easiest thing for you to do is probably to download it and install it again. The latest "stable" (doesn't guarantee much) version can be found here:

http://www.nasm.us/pub/nasm/releasebuilds/2.09.04/win32/

If you're willing to be a "tester" the latest "snapshot" is here:

http://www.nasm.us/pub/nasm/snapshots/latest/win32/

Either of the two files in those directories should work fine - the "installer" is probably easier(?)... We don't offer a pre-built Win64 executable - you'd have to compile it from source yourself. The Win32 build "should" work fine.

If that doesn't solve your problem, get back to us. (Everybody makes mistakes!)

Your proposed .com file probably won't run on a 64-bit Windows system, however (for the same reason). If you want to run dos programs on Win64, you'll need an emulator.

http://www.dosbox.com/

... or similar...

Thanks for the feedback!

Best,
Frank


Offline Mittens

  • Jr. Member
  • *
  • Posts: 2
Re: Beginner Problem
« Reply #2 on: December 02, 2010, 06:32:21 AM »
Downloaded the installer and it works now, thanks a bunch.
I'm sure I just downloaded the wrong build the first time around or something dumb like that.