"Debug" pushing my modest program space over the edge


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2009
    Posts
    653

    Default "Debug" pushing my modest program space over the edge

    At the minute I'm using a lowly 12lf1822...beucase it has the features I need.......with the small footprint.

    I'm right on the edge of filling up the available 4096 kbytes, but I've noticed something peculiar (to me at least)

    Consider the following...

    Code:
    debug dec temp ' output the contents of a variable
    with the above enabled, my program compiles at 2010 words.

    versus

    Code:
    debug "t" ' output the letter t.
    but with the above enabled, my program compiles at just 1945 words.

    so the former uses up 65 more 'words' of program space?!!!



    Why would asking for the debug contents of a word variable apparently use up so much more program space?
    Last edited by HankMcSpank; - 22nd May 2011 at 23:34.

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,521


    Did you find this post helpful? Yes | No

    Default Re: "Debug" pushing my modest program space over the edge

    Hi Hank,
    When you Debug "t" the ASCII code for t is hardcoded into the PICs program memory and sent when the program execution reaches the Debug line.

    When you do Debug DEC temp the debug routine first needs to convert the value stored in temp into ten-thousands, thousands, hundreds, tens and ones 'entities' and then convert the value of each of those 'entities' into its ASCII representation. When we are at this point it starts to be comparable to Debug "t".

    /Henrik.

  3. #3
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default Re: "Debug" pushing my modest program space over the edge

    Thanks Henrik...that explains it (where do pick all this stuff?!!)

Members who have read this thread : 1

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