Do i have ot know C++ or any other programming language completely to start to learn Assembly!!
Printable View
Do i have ot know C++ or any other programming language completely to start to learn Assembly!!
Assembly came before C++, so it would be neat to have to know C++ before you knew Assembly...
knowing Assembly would definately further your understanding of C++ (or any language, for that matter)
try PM'ing Bubba - he's an assembly programmer...
yea actually i made a profound reserach about this "Assembly Programming" and found out this book called "art of assembly programming" as the best resource ever and it says in the book that readers are expected to know C/C++, Basic, Pascal to start ot learn "Assembly"!!
that could possibly be because the book uses programs written in those languages as examples. how would you show what a C++ looping structure looks like in ASM without showing the C++ code along with it?Quote:
Originally Posted by himanch
I don't know if you saw the last line of my previous post because I edited it after you posted, but try to get in contact with Bubba.
ok thanks
and also do u think that it is essential to learn assembly to write extremely good programs??
Currently taking some assembly classes, so I know a bit, but I'd be interested to hear from anyone with real-world experience coding assembly.
I found it interesting as a c++ programmer. I'd read as people discussed things such as function overhead, but only after taking assembly classes did I understand the details. It's also nice being able to look at small chunks of code and knowing roughly how complex it will be in terms of assembly.
At this point though I think the word "essential" is way, way too strong. Modern compilers are incredibly optimized, so you can't make assumptions about the code they will generate based on just a bit of assembly programming. Also, a lot of material in assembly is platform specific. Any of the insight you gain into the x86 or some motorola processor will really never transfer into a HLL like c++.
Of course if you're going to be working near the hardware, it does become important. If you wanted a job at nVidia, you should be looking into it seriously. But if you just want to be able to put "C++ programmer" on your resume, you should probably look at expanding your more universally applicable knowledge.
Disclaimer: I'm a student. All my knowledge of the professional world is second-hand (although I am a good listener). But I think the above is reasonable.
Also, learning anything computer related is never a waste. Even when it's not directly applicable to the field you assume you're going into.
Oh, one other important thing I forgot. Assembly forces you to know computer architecture. And I'm thinking that has to come in handy at some point.
Adding to what AH_Tze said, with the fact that knowing assembly gives you a better understanding of computer architecture, you tend to think about what your high level language code (C/C++/Pascal/etc) is doing behind the scenes. It isn't essential, because as AH_Tze also said, compilers are pretty good at making ASM level optimizations for you. However, many situations can come up where the compiler won't make a better decision than you, but that's usually because you are dealing with a specific situation; the compiler has to make sure it works will all code. However, just by learning ASM you won't see the opportunity for those situations easily. It takes many years of ASM before you're able to do that naturally(I'm hoping I'll get there in about 5-8 years).
Before going to ASM, it is better to try and organize your code so that the compiler spits out better ASM for you. Knowledge of ASM/computer architecture will allow to understand how you can achieve that. Methods such as seperating structs into hot/cold fields, using temporal writes, or unrolling loops will make sense along with countless other tricks.
You may also want to check some things out such as intrinsics or libraries like the SIMD data types (both are compiler specific I believe).
bottom line: It never hurts to learn another language.
Hands down the best book. Assembler syntax is quite different from C, but similar looking to pascal but overall unique. So bearing that in mind, since assembler really does require you to program creatively, other languages will either help guide you in being creative about it, or make you jaded and long for "writing a loop in C." High Level Assembler is a pretty good choice of languages since its just as the name suggests.Quote:
Originally Posted by himanch
I'd still learn the non lazy way first though. To mean learning HL Asm first is like learning C++ first. People who learn C++ before focusing on C tend to be used to writing sloppy code.
that's not at all true... at least in my experince it's the other way around - people who learn C++ first like code that is more readable, where as C coders are more likely to obfuscate their code in order to shed a few miliseconds or avoid having to allocate a few extra bytes...Quote:
Originally Posted by master5001