1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Dismiss Notice

C++ for the C64 (talk)

Discussion in 'C /C ++' started by FBnil, Oct 11, 2016.

  1. FBnil

    FBnil ¡sɥʇuoɯ oʍʇ uı ɐɹʎԀ

    Joined:
    Dec 14, 2012
    Messages:
    1,935
    Location:
    Yurp
    nice C++ insights...



    maybe a rofl around 28 minutes...
     
    Tags:
  2. ptitSeb

    ptitSeb Serial Porter

    Joined:
    Aug 15, 2012
    Messages:
    7,617
    Location:
    France, near Lyon
    Very nice !
     
    FBnil likes this.
  3. sulu

    sulu Guest

    Pretty impressive demonstration of how pointless code optimization is in a high level language if you don't know what's going on low level.
     
    FBnil likes this.
  4. Eight Bit

    Eight Bit Advanced Member

    Joined:
    Nov 16, 2008
    Messages:
    1,210
    Location:
    Amsterdam, Netherlands
    Interesting and impressive.
    I think I'll just stick to pure assembly though. This C++ is beyond me. ;)
     
  5. FBnil

    FBnil ¡sɥʇuoɯ oʍʇ uı ɐɹʎԀ

    Joined:
    Dec 14, 2012
    Messages:
    1,935
    Location:
    Yurp
    @Eight Bit : It seemed like magic to me too. What? Just by adding a virtual declaration? Zero overhead? Impossibru!

    In computer class (a long time ago), we once analized the assembly output of -o 1 and -o 3 (optimization flag). I do not remember which architecture, might have been Sun OS workstations, there was a delay of 1 cycle before a jump to a function, so without optimization it would be:

    1. put parameters of the function in the stack
    2. jump to the function subtroutine
    3. nop (wait until the subtroutine actually runs)
    4. get the values back

    With optimization on it will switch steps 1 and 2, and skip 3... which looked very weird to me, but saves 1 cycle.
    I then managed to make code that ran without optimizations, and locked the machine with... (my faulty code)
     
  6. pocak

    pocak Member

    Joined:
    Oct 11, 2009
    Messages:
    52

Share This Page

Loading...