Save some bytes in program memory


Results 1 to 12 of 12

Threaded View

  1. #2
    Join Date
    Aug 2005
    Location
    Michigan, USA
    Posts
    224


    Did you find this post helpful? Yes | No

    Default Re: Save some bytes in program memory

    I assume you mean 'words' instead of 'bytes'?

    I tried a few variations using the free/lite version of BoostC, just for fun;

    Code:
        if(index < 3)           // 7 words
          index++;              //
        else                    //
          index = 0;            //
    Code:
        index = index++ & 3;    // 6 words
    Code:
        index = ++index & 3;    // 5 words
    Code:
        index = 3 & ++index;    // 4 words
    Code:
        index++;                // 3 words
        index &= 3;             //
    Code:
        index++;                // 2 words
        index.2 = 0;            //
    Now I'm really curious about the assembly code that PBP generated...
    Last edited by Mike, K8LH; - 8th February 2012 at 03:48.

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts