ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
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.
1- Assembly Language Step-by-Step: Programming with Linux2 Oct 2009 by Jeff Duntemann or https://www.tutorialspoint.com/assembly_programming/
for beginner?
4- I need an advice about how to study assembly.
1- In what year of learning assembly language may i found jobs?
2- Which assembly jobs can i found after two years of learning assembly?
Finding jobs that you can do BETTER if you know assembler is easy. Finding one with assembler as a requirement is rare. Finding one with that as the MAJOR requirement is VERY rare.
If you want to be a developer or software engineer, continue with assembler as it makes you THINK into the machine. An invaluable skill! But also learn at least TWO higher level languages. By the time you finish BOTH may be obsolete, but you will find that picking up a new language once you have mastered two is easier. With every language you add, learning the next is easier than learning the last.
1- Assembly Language Step-by-Step: Programming with Linux2 Oct 2009 by Jeff Duntemann or https://www.tutorialspoint.com/assembly_programming/
for beginner?
4- I need an advice about how to study assembly.
1- In what year of learning assembly language may i found jobs?
2- Which assembly jobs can i found after two years of learning assembly?
Years ago, I worked on an IBM operating system (VM/SP, VM/XA, VM/HPO) that was – at the time – coded entirely in assembly language. But, even then, IBM was moving to the use of a high-level language (of their own devising) instead.
Today, quite frankly, CPU architectures are not designed to work with programs that are "hand-coded." Instead, they are built to efficiently process the output of optimizing compilers, and CPU manufacturers such as Intel and AMD work very closely with compiler writers ... and, offer compilers of their own ... in order to transform typical programming-language constructs into efficient code, and to detect and "do the right thing for" any particular CPU model.
To see how assembly code is typically used these days, you need look no farther than the /arch subtree of the Linux kernel, where all "architecture-specific" programming will be found. You'll basically find two sorts of things there:
"Trampoline" code, which is used immediately after Linux is launched on a particular hardware system, in order to set up that hardware sufficiently to let it then "bounce into" the Linux environment.
Short subroutines, which implement specific low-level operations in the actual manner required by "this architecture."
These days, you basically don't find significant work being done "in assembly." Although "C" compilers have traditionally had the asm { ... } directive, Microsoft's latest compilers have actually taken it out(!).
sundial is right. Except for a few subroutines where speed is of the essence and you make extensive use of specialized processor commands (like SSE or equivalent commands in a video compressor or something similar), you're much better off just using C. It's much more legible, maintainable, etc. Assembly, almost by definition, inevitably leads to almost incomprehensible spaghetti code and modern compilers know more about instruction scheduling, pipelining, and optimization than you do. Assembly was important back in the old days like early Macs. where everything was prototyped in Pascal and then hand compiled to Motorola 68000 assembly to squeeze everything out of old processors. This really isn't necessary any more.
Not that you shouldn't learn it, I took an assembly language class in college and it helped me a lot in understanding programming, but I don't really ever actually use assembly.
Also ... here is a link to Intel's online source of the eight(!) manuals which describe the external characteristics of their current microprocessors!
The IBM/360 "Principles of Operation" ("POP") manual consisted of one document designed to be printed using a line-printer.
Manuals describing other microprocessors – 6502, 68000, Z-80 – were similarly thin, and the architectures they described were relatively uncomplicated.
Architectures today are too complex for humans to write efficient code for them using manual methods. But, compilers can do so easily. In the aforementioned manuals, Intel describes how best to write the source-code for maximum optimizability. They provide compilers themselves, and they also work very closely with compiler-writers such as Microsoft and the gcc team.
I recommend that you spend some time in the /arch folders of the Linux source tree, not just for x86 but also for other architectures. You should know enough about x86 assembly to be able to read and understand the subroutines that you find in the proper subdirectories. But you need not expect to write one, yourself.
"Low-level operations" are also best done by using "well-known libraries" to do the actual work. These libraries have been carefully crafted and compiled to do the work, and it is known that they do so correctly.
Last edited by sundialsvcs; 06-08-2017 at 08:21 AM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.