Byte Alignment


Closed Thread
Results 1 to 8 of 8

Thread: Byte Alignment

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

  2. #2
    G4LCH's Avatar
    G4LCH Guest


    Did you find this post helpful? Yes | No

    Smile I guess the question was not than dumb ;=)

    Thanks guys, I did not have a code space problem I just wanted to
    check that as I was switching banks that there could be a way to keep
    the byte alignment and hence speed.

    It come from programming on Mac/PC's where it can make big differences

    Thanks for al your input it was great to have more insight, I learnt even more
    which is fab and one important thing inspect the ASM file ;-)

    Thanks
    Mark

  3. #3
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    It's not nescessarilly a code-space 'problem'. Sometimes in one sequence, PICBasic squeezes a variable (which just happens to be frequently used) into Bank Zero, and you get a tight code-space compilation. You add a couple of variables later, recompile, and now this variable might no longer be in Bank Zero, but is pushed into Bank 1, and suddenly your program code usage is heaps bigger.

    Naturally you jump to the conclusion that shuffling the variables in different sequences varies the code-space used... but it's not the variables themselves, but how they are subsequently accessed that changes the amount of bytes compiled.

    So going back to your original thread starter... yes, there IS a speed and memory advantage... the advantage is in getting your most frequently used variables stored into Bank Zero - it makes a BIG difference if you're optimising for performance and code-space.

  4. #4
    G4LCH's Avatar
    G4LCH Guest


    Did you find this post helpful? Yes | No

    Thumbs up Thanks for the great reply

    Melanie, thanks for your input in this one and your right
    my code does run faster, I moved all of my frequently accessed vars into
    bank0 and hypresto its speed is improved.

    Thanks again for your valuable input.

    Mark

Similar Threads

  1. LCD freeze
    By harryweb in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 5th October 2009, 08:01
  2. Memory use - how much do you use?
    By keymuu in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 10th June 2009, 22:39
  3. byte compression
    By Norbert in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 16th June 2007, 18:04
  4. Microcontroller with 2 way paging application problem
    By oneohthree in forum mel PIC BASIC Pro
    Replies: 30
    Last Post: - 20th April 2007, 17:27
  5. 16F877 RAM Question
    By Art in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 6th August 2005, 11:47

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