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.
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.
So, how should I learn a programming language? I wanted to learn a language soon before I began college, because in High School most of the other students in my Computer Repair classes had already learned how to program and even hack. I don't want to be behind the rest of the students in my classes in college.
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.
You are probably right, but you have to start somewhere. Please do not kill the messenger. the person who asked the original question should of taken the time to do some research. (no offence)
If you have a well written book, you should be able to learn most things. it is like the difference between good and bad support via the phone. I will agree that if you do not get the basics whether it is from a book or where ever, programming will be a challenge no matter what. Building a program is a lot like being an architect. You have to have a model to work from and know the parts it takes to make not only the model but the real thing. That being said, I have seen some elegant code that was not worth a crap. Whether you use oops or not, your still going have to use logic and common sense.
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.
No, most Linux development tools don't work that way. Linux has a much more compartmentalized approach to just about everything. As other posters state, NASM is a command-line program. It is NOT an IDE (Integrated Development Environment) like Microsoft's Visual Basic or C# environments. E. g. NASM does not provide any facilities to edit the files you want it to assemble.
What this means is that you'll need to use your own editor (I use EMACS) to write your assembler program's text. Then you'll save the file, and then you'll need to go into a terminal (like Konsole or XTerm) and type a command to "launch" (Windowism) NASM "on" the assembler file you've just written. It will then compile the file and spit out an executable, which you'll also need to run from the terminal.
Note that this might seem stupid or laborious if you have a deep love / familiarity with Windows and Windows IDE's but that can be illusory. With the "Linux like" approach, you can mix and match tools and compilers much more easily - e. g. when writing C++ programs on a Linux system, you do this too - use your own editor, and compile via makefiles. Effectively Linux can do exactly what a Windows IDE does - you just need the right separate programs correctly setup and a few shell scripts (and maybe some help from "autotools") and it can appear to do what C# or VB does, for example. Only in fact it is several different programs and scripts, not one big monolithic entity that does everything.
So, how should I learn a programming language? I wanted to learn a language soon before I began college, because in High School most of the other students in my Computer Repair classes had already learned how to program and even hack. I don't want to be behind the rest of the students in my classes in college.
Your approach is correct, methinks. For example, I learned to program (well, the little that I can! from a book called "Beginning with C" by Ron House (ISBN 0170088219). He had no references to what operating system you were using, teaching just the basic concepts and some design principles. So I worked through those, and then figured out by using the net and posts here and on other Linux sites, on how to do compile C programs on Linux.
So don't be put off by the practicalities, much of learning how to program is to understand the concepts. Once you've got a single concept down, try and write a tiny program that tests or illustrates that concept. If you find you need practical help on how to write and save a program in Linux, ask just that question in a new thread - you should speedily get good answers.
I think the fact that he WANTS to learn Asm in this day and age should be lauded. There are thousands of C++ programmers out there, and only a handful of good asm ones, so OP - welcome to a new world!
I think the fact that he WANTS to learn Asm in this day and age should be lauded. There are thousands of C++ programmers out there, and only a handful of good asm ones, so OP - welcome to a new world!
I agree! I got my start in TASM on Dos 3.3 - and I often miss the good old days of straight assembly language programming...
Sentiment aside, where is straight assembler still used today? With even the most tiny embedded systems all with absurd amounts of memory vs. the past, where would one still use assembler? Mostly for device drivers?
Me, too. A mixture of Borland TASM some places; Microsoft MASM in others.
STRONG CAVEAT:
* Most of the "best" sites out there for assembly tutorials still use 16-bit opcodes and MASM syntax.
* Unfortunately, that's NOT necessarily a "good thing" for contemporary OS's (such as - but certainly not limited to - Linux).
* I would instead recommend learning true 32- and 64-bit assemblers. In ATT "as" syntax (which is portable to ALL architectures), vs. the "bass-ackwards "MASM" syntax (used by Intel, and Intel only).
My first asm was on an IBM big box at school. Later I was into assembly for the Commodore computers (65xx). In fact, I was luck enough to take a class in person from the late great Jim Butterfield. Find a mentor, it's worth it.
This might be worth checking out. There also some pdf's of books on the web for linux assembly. Not sure whether they are legal or not.
I learned asm (for a few different architectures) before I learned C and long before C++ even existed. That doesn't mean I recommend learning asm before C and C++.
Knowing asm made C and C++ easier for me to learn. But probably knowing C or C++ would have made asm easier to learn.
I learned Basic first. Knowing Basic made the next languages easier to learn (I had significant overlap there, so I can't accurately say which languages I learned second or third etc., but C wasn't want of those next few and asm was). Even though knowing Basic first made other languages easier for me to learn, I absolutely would not recommend learning Basic first (or for that matter, learning Basic at all).
Of the languages that are worth learning now, C++ is a good choice to learn first, and asm isn't.
I think Java might be a slightly better choice for a language to learn first. But C++ is a better language overall, so unless you really need the help provided by an easier first language, I wouldn't suggest Java as a stepping stone to C++ (and if asm is a destination, C++ is a better stepping stone than Java).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.