Nasm: unable to open input file (all of a sudden)

Programming, for all ages and all languages.
Post Reply
Inflated
Posts: 3
Joined: Tue Jan 25, 2011 10:25 am

Nasm: unable to open input file (all of a sudden)

Post by Inflated »

Hello,

Amateur programmer starting to work with assembly language, here, and I'm having a bit of a problem.

Whenever I try to create an object file in nasm, I get the error that it was unable to open the input file. However, just a few minutes ago I was up and running without a hitch. I have no idea what happened.

After searching around, I came across this thread: http://forum.osdev.org/viewtopic.php?f= ... open+input

This leads me to believe that notepad is formatting the file in some strange way or something, I just have no idea how to fix it.

I'd really appreciate any help I can get, as this is quite frustrating :shock:

Thanks!
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Nasm: unable to open input file (all of a sudden)

Post by Combuster »

Hello Inflater,

Do you know where the power button is? I have the idea it might help you (hint) :wink:
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Inflated
Posts: 3
Joined: Tue Jan 25, 2011 10:25 am

Re: Nasm: unable to open input file (all of a sudden)

Post by Inflated »

Thanks for the quick response, but I'm afraid restarting didn't help.

Here's a bit more info if it helps:

When I run nasm16.exe, I get the response that it doesn't have an input file. Okay, that's good.

Then, I try: nasm16 -f obj hello.asm -o hello.obj

And get: nasm: unable to open file 'hello.nasm'.

I'm currently looking for an editor other than notepad, so hopefully that'll help.

EDIT: Same problem with another editor. Arghh.
Inflated
Posts: 3
Joined: Tue Jan 25, 2011 10:25 am

Re: Nasm: unable to open input file (all of a sudden)

Post by Inflated »

Holy **** I got it working.

I'm not exactly sure what was wrong. After changing the directories around, I was getting a new error saying label or instruction expected at the start of the line.'

Turns out there was a space before the [BITS 16] instruction, and after deleting that, viola.

Thanks for responding, and hopefully this will help somebody in the future (though I kinda doubt it :p)
Kieran
Member
Member
Posts: 54
Joined: Mon Apr 11, 2005 11:00 pm

Re: Nasm: unable to open input file (all of a sudden)

Post by Kieran »

You could post this as a bug on the nasm site, as this may be an error handling bug.

First try the latest nasm build to see if it does the same.
shahadat
Posts: 19
Joined: Thu May 13, 2010 2:53 am

Re: Nasm: unable to open input file (all of a sudden)

Post by shahadat »

did u checked the file extension.
sometimes notepad saves a file named as example.asm.txt instead of example.asm.
User avatar
Firestryke31
Member
Member
Posts: 550
Joined: Sat Nov 29, 2008 1:07 pm
Location: Throw a dart at central Texas
Contact:

Re: Nasm: unable to open input file (all of a sudden)

Post by Firestryke31 »

Seeing that you're using Windows, you might consider Programmer's Notepad 2. It has syntax highlighting for x86 ASM (among many others), and can run NASM (or my preferred assembler, YASM) if you set it up to. Also, it lets you choose the extension rather than just adding .txt.
Owner of Fawkes Software.
Wierd Al wrote: You think your Commodore 64 is really neato,
What kind of chip you got in there, a Dorito?
Post Reply