Skip to main content
GameDev.net gamedev.net
🔒 Locked

somthing you dont hear to often

Started by atomic_west Sep 9, 2005 at 7:51 PM 18 replies 3.5k views
Original Post
atomic_west
atomic_west
Well here we go Ive been tooling around with programing for a few years and am prety much still a newb. I was pointed twards assembly and am strugling to figure out how to use it from the comand line. I cant get the nasm-ide to work but that is beside the point. I got nasm to work from the comand line but Im having trobble getting it open the files I give to it as input they are written in notepad I type c:\nams>nasm16 hello.asm -o hello.com and I get the responce from the assembler nasm:unable to open input file 'hello.asm' what am i doing wrong?
Drew_Benton
Drew_Benton
Is "hello.asm" in the same folder as the nasm executable?
tompp
tompp
theoretically it should work if the source is in the current directory. Why do you run nasm16 if you running Windows ?
Beware of the Mighty Hamster!
atomic_west
atomic_west
Yes it is. i figured out how to use nasm from it documentation and could be mistaken as how to do this all and it vertanly isnt simple!
tompp
tompp
http://nasm.sourceforge.net
Beware of the Mighty Hamster!
atomic_west
atomic_west
im using nasm16 because it is the version that came with the book i have "assembly language steap-by-steap.
let me gues there is a newer version i should have downloaded?
tompp
tompp
i recommend it. i believe nasm16 is the 16bit DOS version of the compiler.

it seems that sourceforge is down for maintenance

http://www.kernel.org/pub/software/devel/nasm/binaries/win32/



Toom#
Beware of the Mighty Hamster!
atomic_west
atomic_west
it seems th only difference between the two is the latter supports win32 programing they both assemble the same thanks hopefully i can work with this the documentation is in better format also
thugkilla
thugkilla
If you are using C++ an ide was easier for me and you can always use that ,but if its Java its easier to use command prompt for me.
atomic_west
atomic_west
Are you saying I should use a c++ ide to write the text doc or asking me if Im coding c++? I using notepad to do all my code and im writing assembly code.

org 100h
mov dx,msg
mov ah,9
int 21h
mov ah,4Ch
int 21h
msg db 'Hello, World!',0Dh,0Ah,'$'
this is also the code in the doc
i got it off the net
and the message i get back from nasm is
nasm: fatal: canot open input file 'hello.asm'
any ideas is there somthing wrong with the code?

[Edited by - atomic_west on September 10, 2005 9:52:37 AM]
Drew_Benton
Drew_Benton
Ok, I'll try to explain again with a picture.

After you type your code in the hello.asm file. SAVE it to the directory that the executable is in. Then at your command prompt, of which you are in the same directory as you nasm exe, run the nasm executable with the command line in your first post. Everything will work. This output is from using the 32bit nasm that tompp has posted the link for. My Hello.asm is the same code you posted:
org 100hmov dx,msgmov ah,9int 21hmov ah,4Chint 21hmsg db 'Hello, World!',0Dh,0Ah,'$'


Image Hosted by ImageShack.us
atomic_west
atomic_west
Thank-you for describing to me the same process that I use the only difrence is the results, I get an error, you get a .com file. My question is why and can you help me to make this work?
Im not stupid and I have spent 3 hrs a day and 5 days trying to find a solution so I can learn assembler and am getting tired of landing at square one.

[Edited by - atomic_west on September 10, 2005 12:01:31 PM]
TheNobleOne
TheNobleOne
If you are using notepad to save make shure you click all files before saving your file as hello.asm. If you don't say all files you will get hello.asm.txt and in the explorer view you will see hello.asm. Then obviously the assembler will say it can't find the file hello.asm because it would be hello.asm.txt.
My JournalComputer science education cannot make anybody an expert programmer any more than studying brushes and pigment can make somebody an expert painter. (Eric Raymond)"C makes it easy to shoot yourself in the foot. C++ makes itharder, but when you do, it blows away your whole leg."-- Bjarne Stroustrup
Dave Hunt
Dave Hunt
Quote:
Original post by TheNobleOne
If you are using notepad to save make shure you click all files before saving your file as hello.asm. If you don't say all files you will get hello.asm.txt and in the explorer view you will see hello.asm. Then obviously the assembler will say it can't find the file hello.asm because it would be hello.asm.txt.


Which is exactly why Notepad should never be used for anything. :)
SiliconMunky
SiliconMunky
Quote:
Original post by Dave Hunt
Which is exactly why Notepad should never be used for anything. :)


No no, that's exactely why you shouldn't hide known file extensions. :)
Drew_Benton
Drew_Benton
Quote:
Original post by SiliconMunky
Quote:
Original post by Dave Hunt
Which is exactly why Notepad should never be used for anything. :)


No no, that's exactely why you shouldn't hide known file extensions. :)


Agreed on all counts [smile] It's stupid that Windows sets that option by default. Disasters just waiting to happen right there.
Dko
Dko
Quote:
Original post by Drew_Benton
Quote:
Original post by SiliconMunky
Quote:
Original post by Dave Hunt
Which is exactly why Notepad should never be used for anything. :)


No no, that's exactely why you shouldn't hide known file extensions. :)


Agreed on all counts [smile] It's stupid that Windows sets that option by default. Disasters just waiting to happen right there.


And why im driven insane trying to help friends online with there computers. Most have never seen a file extension and it drives me batty when they say a file doesn't exist. >.<

silverphyre673
silverphyre673
May I just ask who pointed you towards assembly, and why? I mean, if you are interested in programming games, aside from calculator games, it really isn't especially useful to know if you are just beginning. Of course, if you want to get into OS development, or when you need to optimize something and you know exactly what you're doing, then you need it.

Anyways, just wanting to make sure you know a bit about what you are getting into and I would be curious as to what your interests are. And I hope, for your sake, that the conversation/thread didn't go like this:

Quote:

"So, I have this great idea for an MMORPG, but I don't know how to program. Can anyone recommend a way that I can realize this dream?"

"Oh yeah, I would recommend either HTML and Variables++, or perhapse some assembly."


Just had to ask after you got 17 useful replys, sorry =)
my siteGenius is 1% inspiration and 99% perspiration
Gink
Gink
Quote:
Original post by atomic_west
Thank-you for describing to me the same process that I use the only difrence is the results, I get an error, you get a .com file. My question is why and can you help me to make this work?
Im not stupid and I have spent 3 hrs a day and 5 days trying to find a solution so I can learn assembler and am getting tired of landing at square one.


Once you download nasmide, go to the directory and type nasmide and it should open up. All you do is go to options/assembler, and set it to COM executable binary file. Also use ALINK as the linker for when you decide to use real mode.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.