Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hello,
As the title suggests, I am accustomed to Windows, and I am inexperienced with Linux. What I am trying to do is open NASM in Linux Mint. After several (poorly made) attempts at finding binaries on the hard drive that might open NASM, I have concluded that the problem is my own inexperience.
I have installed NASM using Synaptic in hopes that I might learn x86 assembly, and I am using Linux as that is the OS that is used in the book I am using to teach myself. Unfortunately, as I have stated, I cannot even figure out how to open NASM, and thus I cannot test what I have learned.
You can try to find the nasm binary using any of the following.
Code:
which nasm
locate nasm
find / -type f -name nasm
The binary should have been installed in one of the system binary directories such as /bin or /usr/bin or some directory that is in your PATH environment variable. I just installed it. The nasm binary ended up in /usr/bin on my Ubuntu 10.04 system.
Code:
echo $PATH
All of this should be done in a terminal.
When you say that you cannot open nasm I wonder if you think it is going to open a window. It won't. It is a command line utility. You use it by opening a terminal window and typing nasm followed by the appropriate arguments.
nasm is a command line utility so you will need to be in a terminal. It will be in your PATH by default so you should be able to run it simply by typing it's name
So, I'm assuming, I would have to make a program first, then I would have to use the terminal, typing "nasm," then typing the name of the file afterwards in order to open the program?
So, I'm assuming, I would have to make a program first, then I would have to use the terminal, typing "nasm," then typing the name of the file afterwards in order to open the program?
Thank you for your help. As of yet, I haven't written any programs (as previously, I thought that opening the assembler would bring up a window that I could type the program into), but I have confidence in the instructions given. Once again, thank you.
Actually the assember (nasm) will create an object file. That file will have to be linked to create an executable file. Then you use the chmod utility to change the file permissions on the executable file. This will allow the operating system to run it.
(as previously, I thought that opening the assembler would bring up a window that I could type the program into),
Nasm doesn't work that way on Windows either. It is a command line program, not a GUI.
Most people use a text editor for typing in the asm program. On Linux I use kwrite as a text editor.
Setting up an IDE such as KDevelop for use with nasm both as an editor for typing in the program and as a front end for the debugger is a moderate amount of work and not well documented. But it may be worth the effort to make your continued use of nasm easier.
Once set up (the hard part) KDevelop integrated with nasm would work the way you apparently expected nasm to work on its own.
Nasm doesn't work that way on Windows either. It is a command line program, not a GUI.
Most people use a text editor for typing in the asm program. On Linux I use kwrite as a text editor.
Setting up an IDE such as KDevelop for use with nasm both as an editor for typing in the program and as a front end for the debugger is a moderate amount of work and not well documented. But it may be worth the effort to make your continued use of nasm easier.
Once set up (the hard part) KDevelop integrated with nasm would work the way you apparently expected nasm to work on its own.
Yeah, I was basing my assumption on previous experiences with various C++ compilers on Windows, such as DevC++ (I think that is what it was called). On a side note, I have never actually learned C++; what I am trying to learn now is my first programing language. I have heard that it would be easier to learn other languages, but I have also heard that learning assembly first would make it even easier to learn said languages.
Call me inexperienced (and you'd be right in doing so), but when I see the acronym IDE, I think of the IDE cable that connects older hard drives to motherboards. I have seen IDE used for other purposes, such as the way you're using it, but I have no clue what IDE means when it is used like that.
Yeah, I was basing my assumption on previous experiences with various C++ compilers on Windows, such as DevC++
Visual Studio or Dev Studio is Microsoft's IDE. It is integrated with Microsoft Visual C++ (and other languages). Since they are purchased together (or downloaded together for "express edition") and used together, the distinction between the compiler and the IDE is somewhat hidden. But the part you thought was the compiler is actually the IDE.
Linux does not have an IDE as full featured as Dev Studio nor as easy to install correctly. Linux software is typically easier to install than Windows software, but IDE's are an exception. Most parts of any IDE are optional, so its maintainers don't want it bloated by having it install every optional part. But no one seems to have a good solution to getting all the right parts installed. Microsoft Dev Studio leans much more toward a bloated default install to reduce the chance that the options you need are missing.
Quote:
I have never actually learned C++; what I am trying to learn now is my first programing language. I have heard that it would be easier to learn other languages, but I have also heard that learning assembly first would make it even easier to learn said languages.
I think you would be much better off learning C++ first. If you learn something about programming along with your first programming language then whatever language you learn first will make the next ones easier. There is no useful beginner subset of asm programming. Anything a beginner can do in asm will be so pointless and silly that it doesn't teach much in the way of programming concepts. There is no point to selecting such a hard language first.
The right subset of C++ would be far easier for a beginning programmer to learn, while still powerful enough to write interesting programs that help teach important programming lessons.
If you really, really want to learn asm first, nasm is still not a good choice. Almost any nasm tutorial you find assumes you are running in DOS or an emulation of DOS. That is not a good fit for Linux. The Gnu Assember is a better choice for learning assembler on Linux (still a much worse choice than learning C++ first, but better than nasm). Long ago, I contributed some time and ideas and debugging, etc. to the nasm project. So I think I'm more likely to be biased in favor of nasm than against it. But the objective arguments against nasm outweigh that bias.
I don't see how! That is a three year old discussion where the right question is asked, but then seems to be discussed only by people who don't know the answer, then some minor (probably obsolete) info about eclipse is tacked on the end.
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524
Rep:
You can't learn oo techniques from a book. You must learn very basic things first. It's like trying to learn to play a guitar by reading a book. If you don't understand programming itself, learning a programming language won't be much help.
I think you would be much better off learning C++ first. If you learn something about programming along with your first programming language then whatever language you learn first will make the next ones easier. There is no useful beginner subset of asm programming. Anything a beginner can do in asm will be so pointless and silly that it doesn't teach much in the way of programming concepts. There is no point to selecting such a hard language first.
The right subset of C++ would be far easier for a beginning programmer to learn, while still powerful enough to write interesting programs that help teach important programming lessons.
Very well, then. I will try to learn C++ first. The only other reason I wanted to learn assembly first is because I found a cheap, well-rated book that claimed to be for beginners in programming. Other than that, I will put off assembly language for another time. Thank you for your help.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.