Wanna learn Assembly?

This is a discussion on Wanna learn Assembly? within the A Brief History of Cprogramming.com forums, part of the Community Boards category; Oh, for goodness' sake! It's obvious that nothing will ever run faster than Assembly Language. That's just a rediculous statement! ...

  1. #106
    Señor Member
    Join Date
    Jan 2002
    Posts
    561
    Oh, for goodness' sake! It's obvious that nothing will ever run faster than Assembly Language. That's just a rediculous statement!
    What about machine language? ASM is a translation of machine language, and who knows if our translation is a little bit inefficient in places?

  2. #107
    ¡Amo fútbol!
    Join Date
    Dec 2001
    Posts
    2,136
    From what I understand, I don't think the translation could be inefficient. Each command in asm directly represents a processor's command. (Of course, I am probably wrong.)

  3. #108
    Registered User VBprogrammer's Avatar
    Join Date
    Mar 2002
    Posts
    175
    Thats 100% correct golfinguy4, there is no error in convertion as golfinguy4 says because with assembly (although some assemblers to give alittle help to the programmer this is usually minimal) each command is translated directly into hex codes (or machine code as you know it), i could take out my intel developers manual volume II and completely hand compile a programme from ASM, however it would be the exact same as if i had used an assembler.

    p.s. you might like to note that compuboy is writing his own OS and is a mod over on the assembly board on flashdaddee, i dont think your going to catch him out that easily!
    VC++ 6

  4. #109
    TK
    Guest
    assemby code has no intelligence, certianly in time it will be possible to write much faster and useful code. Why would one want to download and compile 10,000 lines of fragmented code, when they only need to use 4500 lines of that code. Personally I would rather have the control.

  5. #110
    Registered User Compuboy's Avatar
    Join Date
    Apr 2002
    Posts
    16

    ASM

      TK, I don't think you quite understand the idea of ASM. The whole point is that you're telling the processor exactly what to do. By doing this directly, you're getting exactly what you want. If you're a good assembly programmer, there won't be a single wasted byte in your program, meaning much faster code than any compiler could ever produce.

      All compilers do is translate your higher-level language to machine code (which is viewable as ASM code). As in any process, the more steps you go through, the lower the quality of the result. High-level code must go through a compiler, which attempts to translate the code to ASM as best as it can. Since it never knows exacty what you're doing, it could never produce ASM code which is as efficient as if you had written it yourself.

      If you want to think on a technical level, though, you'll find that C compilers rely on the stack to store their variables. If you write your own ASM code, it is possible to use registers in almost all cases, significantly increasing the speed of execution.

      The question was never whether any language could run faster than ASM, it's quite obvious that that's not possible. The real question is when to use ASM and when to use a higher-level language. ASM can be time consuming and difficult to write. High-level languages are a lot easier to write and maintain, but the resulting machine code will be less efficient than if it had been written straight in assembly.

  6. #111
    TK
    Guest
    And I am saying that high level languages will be far more efficient than ASM or compiled binary. Code can be compiled intelligently, while you are working.There is no reason why everything needs to be compiled before hand, therefore high level language will be faster than binary executable code, nevermind assembly.

  7. #112
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,789
    No matter when the code is compiled or how intelligent the framework the program will have to interact with the processor.......whether code is interpreted at runtime, or loaded from an image, the processor expects binary instructions.........


    I doubt that the avarage processor is at all interested in the hairbrained nonsense that Microsoft's marketing people can come up with.........

  8. #113
    Registered User Mario's Avatar
    Join Date
    May 2002
    Posts
    317
    >> I doubt that the avarage processor is at all interested in the hairbrained nonsense that Microsoft's marketing people can come up with.........

    It has been ever since DOS.

    What I don't understand is this concern over efficiency with today's processors. Granted, the diference between sloppy code and "good" code is a factor. But is it when we comparing good C code with good ASM code? Or even compile on demand with pre-compiled?

    I don't think there is that much of a difference when the software we talk about is the day-to-day software we see on shelves in the mall. And that is, I believe what we are talking about here.
    Regards,
    Mario Figueiredo
    Using Borland C++ Builder 5

    Read the Tao of Programming
    This advise was brought to you by the Comitee for a Service Packless World

  9. #114
    ..
    Guest
    You will have no choice but to work at a high level if you want to use sophisticated programs. Code will be in the form of an intermediate langauge so that it is cross platform compatible.

    It's strange that all the Microsoft haters are using a Microsoft operating system. Try Linux, that's what I'm using right now.

  10. #115
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,789
    Originally posted by ..
    It's strange that all the Microsoft haters are using a Microsoft operating system. Try Linux, that's what I'm using right now.
    Same answer as I always give - I dont have a go at their products......just them.....

    I spend all the time I can learning programming for windows with VC++ and stuff like WSH.............And I dont need to kiss M$'s butt or believe all the laughable crap that comes from their marketing sources to use their products....

  11. #116
    TK
    Guest
    So what your saying is that you are a pure Microsoft Windows user and programmer, and Microsoft sucks? Well, I don't think someone can help you with that, you should help yourself though.

  12. #117
    ..
    Guest
    I don't think that it pays off to bury your head and not pay attention to modern technology such as the .net framework and Java. Your going to get your ass kicked if you don't face it.

  13. #118
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,789
    Originally posted by ..
    I don't think that it pays off to bury your head and not pay attention to modern technology such as the .net framework and Java. Your going to get your ass kicked if you don't face it.
    Hmm...so we're talking about a mythical high level language that operates faster than sending binary instructions to a processor....and you bring up Java as a case in point???

    Have you ever considered a career in standup comedy?

  14. #119
    ....
    Join Date
    Aug 2001
    Location
    Groningen (NL)
    Posts
    2,386
    And I am saying that high level languages will be far more efficient than ASM or compiled binary.
    A language is just a mathematical concept. It is the compiler which it is all about. Sure, there are compilers which do a good optimizing job. But a compiler cannot reason like a human can. A human can think about the concept of the code, the compiler only compiles the code. The compiler cannot think about high-level relations between software, a human can see these high-level relations and use these relations to optimize the code.

    Code can be compiled intelligently, while you are working.
    While you're working? What do mean with that?

    There is no reason why everything needs to be compiled before hand, therefore high level language will be faster than binary executable code, nevermind assembly.
    You realise that compiled high level language IS binary executable code?

    I doubt that the avarage processor is at all interested in the hairbrained nonsense that Microsoft's marketing people can come up with.........
    In fact it does. The MMX instructions use the FPU registers. This means that when using MMX instructions, you can't use the FPU and vice versa. The reason for this was that OS'es like Linux and those of Microsoft store the FPU state. So it is always known if MMX will be used or FPU, which means that no adaptations to the OS architecture need to be made, which saves money. So in this case Intel was interested in the opinion of Microsoft and others.

    Hmm...so we're talking about a mythical high level language that operates faster than sending binary instructions to a processor....and you bring up Java as a case in point???

    Have you ever considered a career in standup comedy?
    Again, a language doesn't operate faster or slower. But the speed of software depends on the programmer and the compiler.

  15. #120
    Registered User Compuboy's Avatar
    Join Date
    Apr 2002
    Posts
    16

    Lightbulb Riiight!

      Ooookay, I've finally figured out what TK is on about! He's trying to say that an interpreted language such as BASIC will run faster than a precompiled/assembled language such as Assembly! TK, are you saying that Javascript runs faster than Assembly Language? Hehe, what fun!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. wanna learn all about network programming
    By manav in forum Networking/Device Communication
    Replies: 3
    Last Post: 03-24-2008, 01:45 AM
  2. Assembly question
    By linucksrox in forum Tech Board
    Replies: 13
    Last Post: 04-08-2007, 06:41 PM
  3. Assembly....
    By Victor in forum Linux Programming
    Replies: 8
    Last Post: 12-28-2004, 12:46 AM
  4. assembly language...the best tool for game programming?
    By silk.odyssey in forum Game Programming
    Replies: 50
    Last Post: 06-22-2004, 01:11 PM
  5. Wanna Learn...
    By Timer in forum Windows Programming
    Replies: 12
    Last Post: 07-19-2002, 01:33 PM

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