c to asm source lines ratio

Discussion in 'C Programming' started by ca1, May 28, 2008.

  1. ca1

    ca1 Guest

    i wonder how much it might be.
    my guess is 4 for average short function about 20 lines x 80
    characters.
    i know it is very difficult to come up with some "average c code" and
    "average asm code" .... nevertheless someone might have some
    experience.
    - thanks
    ca1, May 28, 2008
    #1
    1. Advertising

  2. ca1

    santosh Guest

    ca1 wrote:

    > i wonder how much it might be.
    > my guess is 4 for average short function about 20 lines x 80
    > characters.
    > i know it is very difficult to come up with some "average c code" and
    > "average asm code" .... nevertheless someone might have some
    > experience.
    > - thanks


    The answer would be different for different pieces of code and for CISC
    vs. RISC architectures. Generally the assembler equivalent of a segment
    of C code tends to be several times as long in terms of lines. Some
    assembler dialects can have multiple instruction mnemonics in a single
    line and of course C code can be written in wide ranging manner with
    regard to vertical space. Compiler optimisation can dramatically affect
    this ratio to IME.
    santosh, May 28, 2008
    #2
    1. Advertising

  3. In article <>,
    ca1 <> wrote:
    >i wonder how much it might be.
    >my guess is 4 for average short function about 20 lines x 80
    >characters.
    >i know it is very difficult to come up with some "average c code" and
    >"average asm code" .... nevertheless someone might have some
    >experience.


    Completely unscientific experiment with a small number of small programs:
    about 6 2/3.

    --
    "Do not on any account attempt to write on both sides of
    the paper at once." -- Walter C. Sellar
    Walter Roberson, May 28, 2008
    #3
  4. ca1

    Walter Banks Guest

    It is not a reliable metric. We have examples where several lines
    of source yields one instruction and the converse is also true.

    w..


    ca1 wrote:

    > i wonder how much it might be.
    > my guess is 4 for average short function about 20 lines x 80
    > characters.
    > i know it is very difficult to come up with some "average c code" and
    > "average asm code" .... nevertheless someone might have some
    > experience.
    > - thanks
    Walter Banks, May 28, 2008
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Raidenji

    Ratio problem.

    Raidenji, Dec 1, 2003, in forum: Perl
    Replies:
    1
    Views:
    530
    Nick Santos
    Dec 1, 2003
  2. =?Utf-8?B?RGF2aWQgV2hpdGNodXJjaC1CZW5uZXR0?=

    Newbie: Image button aspect ratio

    =?Utf-8?B?RGF2aWQgV2hpdGNodXJjaC1CZW5uZXR0?=, Nov 6, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    1,195
    Scott M.
    Nov 7, 2004
  3. Arthur Hsu
    Replies:
    5
    Views:
    5,893
    Steven Cheng[MSFT]
    Dec 8, 2004
  4. Brian
    Replies:
    1
    Views:
    1,090
    Bruce Barker
    Dec 6, 2005
  5. Bremse

    signal to noise ratio

    Bremse, Feb 2, 2005, in forum: Java
    Replies:
    0
    Views:
    356
    Bremse
    Feb 2, 2005
Loading...

Share This Page