C++ and Assembly

This is a discussion on C++ and Assembly within the C++ Programming forums, part of the General Programming Boards category; Do i have ot know C++ or any other programming language completely to start to learn Assembly!!...

  1. #1
    Whats gonna happen now! himanch's Avatar
    Join Date
    Feb 2005
    Location
    Armenia
    Posts
    26

    C++ and Assembly

    Do i have ot know C++ or any other programming language completely to start to learn Assembly!!
    Hayda!!!Whats gonna happen tomorrow

  2. #2
    Registered User major_small's Avatar
    Join Date
    May 2003
    Posts
    2,787
    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...
    Last edited by major_small; 02-08-2005 at 01:58 PM. Reason: sudden onset of dyslexia
    Join is in our Unofficial Cprog IRC channel
    Server: irc.phoenixradio.org
    Channel: #Tech


    Team Cprog Folding@Home: Team #43476
    Download it Here
    Detailed Stats Here
    More Detailed Stats
    52 Members so far, are YOU a member?
    Current team score: 1223226 (ranked 374 of 45152)

    The CBoard team is doing better than 99.16% of the other teams
    Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)

    Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT

  3. #3
    Whats gonna happen now! himanch's Avatar
    Join Date
    Feb 2005
    Location
    Armenia
    Posts
    26
    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"!!
    Hayda!!!Whats gonna happen tomorrow

  4. #4
    Registered User major_small's Avatar
    Join Date
    May 2003
    Posts
    2,787
    Quote Originally Posted by himanch
    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?

    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.
    Join is in our Unofficial Cprog IRC channel
    Server: irc.phoenixradio.org
    Channel: #Tech


    Team Cprog Folding@Home: Team #43476
    Download it Here
    Detailed Stats Here
    More Detailed Stats
    52 Members so far, are YOU a member?
    Current team score: 1223226 (ranked 374 of 45152)

    The CBoard team is doing better than 99.16% of the other teams
    Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)

    Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT

  5. #5
    Whats gonna happen now! himanch's Avatar
    Join Date
    Feb 2005
    Location
    Armenia
    Posts
    26
    ok thanks
    Hayda!!!Whats gonna happen tomorrow

  6. #6
    Whats gonna happen now! himanch's Avatar
    Join Date
    Feb 2005
    Location
    Armenia
    Posts
    26
    and also do u think that it is essential to learn assembly to write extremely good programs??
    Hayda!!!Whats gonna happen tomorrow

  7. #7
    Registered User
    Join Date
    May 2003
    Posts
    82
    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.

  8. #8
    Registered User
    Join Date
    May 2003
    Posts
    82
    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.

  9. #9
    vae victus! skorman00's Avatar
    Join Date
    Nov 2003
    Posts
    594
    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.

  10. #10
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    Quote Originally Posted by himanch
    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"!!
    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.

    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.

  11. #11
    Registered User major_small's Avatar
    Join Date
    May 2003
    Posts
    2,787
    Quote Originally Posted by master5001
    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...
    Join is in our Unofficial Cprog IRC channel
    Server: irc.phoenixradio.org
    Channel: #Tech


    Team Cprog Folding@Home: Team #43476
    Download it Here
    Detailed Stats Here
    More Detailed Stats
    52 Members so far, are YOU a member?
    Current team score: 1223226 (ranked 374 of 45152)

    The CBoard team is doing better than 99.16% of the other teams
    Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)

    Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21