better coding methods to freeing active ram in small pics


Closed Thread
Results 1 to 12 of 12

Hybrid View

  1. #1
    Join Date
    Feb 2012
    Location
    PERTH AUSTRALIA
    Posts
    838


    Did you find this post helpful? Yes | No

    Default Re: better coding methods to freeing active ram in small pics

    interesting - had code that was compiling to 2001 words , code had a large section of select case with 24 case options ( buttons ) , replacing them with if then , compiled to 1978 words , does not look as nice but heck worth the saving in program space

  2. #2
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,139


    Did you find this post helpful? Yes | No

    Default Re: better coding methods to freeing active ram in small pics

    When I have bits using them as bit variables or flags, I set them as this:

    Code:
    my_flag    var byte
      flag1      var my_flag.0
      flag2      var my_flag.1
    
    etc
    Also recently Darrel gave a tip for a calculation.

    Code:
    IF ABS(x-y)>16 THEN...
    Using this:

    Code:
    IF X>Y THEN
        Z=X-Y
    ELSE
       Z=Y-X
    ENDIF
    which compiles about the half size.

    So, a little common sense and experimenting is all that is needed.

    Ioannis

Similar Threads

  1. amount of ram
    By vicce67 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 5th November 2012, 17:15
  2. Re-programming SM PICS on small PCBs
    By tekart in forum General
    Replies: 0
    Last Post: - 11th April 2011, 17:07
  3. Active low input?
    By CosMecc in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 8th August 2010, 20:31
  4. Alternative Methods ...
    By T.Jackson in forum Off Topic
    Replies: 3
    Last Post: - 9th June 2008, 13:13

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