Understanding ASM

This is a discussion on Understanding ASM within the A Brief History of Cprogramming.com forums, part of the Community Boards category; "writing a C compiler in VB !" hahahhah Kuphryn...

  1. #16
    Registered User
    Join Date
    Nov 2001
    Posts
    1,348
    "writing a C compiler in VB!"

    hahahhah

    Kuphryn

  2. #17
    Registered User VBprogrammer's Avatar
    Join Date
    Mar 2002
    Posts
    175
    Possible but no, not a good idea!
    VC++ 6

  3. #18
    the Corvetter
    Join Date
    Sep 2001
    Posts
    1,584
    Summed up (I just had to get in on this conversation )...

    ::drum roll::

    No language is perfect. Every language has their ups and their downs. You choose which language suits your ups, and the downs are take-able (able to be delt with). It's not hard to see the ups and downs of Assembly. It's quick, it's efficient, the programmer has all control. And, there are the downs: it's hard to debug, hard to make use of resources and just plainly hard to read. It's hard to code. It takes long. But, as a programmer and with my "department" of programming, I choose Assembly because I think the ups outweigh the downs. Some differ, because they do different types or programming. Both C and Assembly and very noble and great languages. They are my two favorites, actually!
    1978 Silver Anniversary Corvette

  4. #19
    ggs
    ggs is offline
    C > C++ duders ggs's Avatar
    Join Date
    Aug 2001
    Posts
    435
    www.hugi.de/compo
    ^^ great assembly size opt competition, several per year..

    [/hijack]
    .sect signature

  5. #20
    the Corvetter
    Join Date
    Sep 2001
    Posts
    1,584
    Thanks! I think I'll enter, maybe...
    1978 Silver Anniversary Corvette

  6. #21
    Blank
    Join Date
    Aug 2001
    Posts
    1,034

  7. #22
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,831
    VBprogrammer:

    >>> it is increably fast and produces small tight code.

    No. It can be incredibly fast and it can produce small tight code, the results are only as good as the author. It is easier to do the same with a modern optimising compiler.

    Unless you really know your hardware, writing a routine in assembler can be counter productive. One needs to consider how cacheing, instruction pipelining, etc. etc., are performed in the chip. The developers of the compilers optimising software have done this for you.

    >>> the fountain of useless information commonly known as an "Old Fart".

    The characteristic of an old fart is that they live in the past. Surely, by advocating the newer technology over the old, I am exhibiting the the opposite trend. However, I, of course, don't give a damn about what you think about me, why should I?

    >>> but why doesnt that show in his post?

    I think my post gave clear and concise opinions/answers to the questioners question. What is wrong with that?

    General:

    There are very few general applications for assembler these days. Where they exist, they are in small niches. (I routinely write assembler for one particular customer - they use Fairchild F8 microprocessors - a dead chip with no reliable compiler - niche). Otherwise it is speed of development/time to market and maintenance that rule.

    Learning some assembler, (maybe at the conceptual level), may give an insight to general processor operations, however, with modern chips, (and the ever growing rate of chip development), there is little real point unless you are aiming at one of the niche markets.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  8. #23
    Registered User
    Join Date
    Nov 2001
    Posts
    1,348
    Okay. Thanks.

    One last subtopic. As I mentioned, I have seen simple ASM code and for some reason, I believe ASM can be fun. Again, maybe I feel that way because I have absolutely no knowledge of ASM. Nonetheless, I find incorporating ASM into a C++ program seems fun, interesting, and even innovative.

    At what point do you learn to incorporate ASM code into C/C++? For example, do ASM books teaches the procedure or it is sort of like an individual discovery type of thing?

    I understand completely that to incorporate ASM into C/C++ one must understand ASM well.

    Kuphryn

  9. #24
    Registered User Nutshell's Avatar
    Join Date
    Jan 2002
    Posts
    1,020
    yea i want to know what kind of books would show how to implement inline asm kind of stuff?

  10. #25
    ....
    Join Date
    Aug 2001
    Location
    Groningen (NL)
    Posts
    2,386
    >At what point do you learn to incorporate ASM code into C/C++?
    >For example, do ASM books teaches the procedure or it is sort of like an individual discovery type of thing?

    I do not know exactly what you mean with incorporating ASM into C/C++. There are two ways to use ASM in combination with C/C++.
    1. Using inline assembly, if available.
    2. Assembling external assembly-routines and link them with your C/C++ routines.

    In most books, when learning C or C++, you don't learn assembly. Only books on subjects like assembly, computer architecture or related treat using mixed assembly and C.

    A lot of compiler manuals on C and C++ compilers also have some chapters on mixed code.

    >yea i want to know what kind of books would show how to implement inline asm kind of stuff?

    Most compilers I've used, each had its own way of implementing inline asm. So I would suggest to check out the manuals of your compiler, you could also visit their site, if there is one.

  11. #26
    Registered User
    Join Date
    Jun 2002
    Posts
    151
    >Some differ, because they do different types or programming.<

    [fanfare]
    What type of programming do you do?
    [/fanfare]

  12. #27
    the Corvetter
    Join Date
    Sep 2001
    Posts
    1,584
    >> No. It can be incredibly fast and it can produce small tight code, the results are only as good as the author. <<

    This is true. A good and experienced C programmer will write a faster program than a sloppy Assembly programmer. This is a very big, if not the biggest, aspect of how the program will turn out...
    1978 Silver Anniversary Corvette

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. gcc asm code syntax
    By Uberapa in forum C Programming
    Replies: 4
    Last Post: 06-15-2007, 02:16 AM
  2. Asm + C++
    By JaWiB in forum C++ Programming
    Replies: 17
    Last Post: 06-26-2003, 04:13 PM
  3. Inline asm
    By wavering in forum C Programming
    Replies: 2
    Last Post: 01-29-2002, 02:42 AM
  4. asm mov
    By manu in forum C++ Programming
    Replies: 1
    Last Post: 12-15-2001, 12:59 PM
  5. My graphics library
    By stupid_mutt in forum C Programming
    Replies: 3
    Last Post: 11-26-2001, 06:05 PM

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