Get a 62.5% more program space easily


Closed Thread
Results 1 to 6 of 6

Hybrid View

  1. #1
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    interesting idea if you only need plain text in Upper Case. Good job! Now how do you save this to your codespace?

    Did you already look here for a thread called Embedded String in your code space?
    See the short story there http://www.pbpgroup.com/modules/wfse...p?articleid=10

    Easier does it?
    Last edited by mister_e; - 6th April 2006 at 23:15.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  2. #2
    serandre's Avatar
    serandre Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mister_e
    interesting idea if you only need plain text in Upper Case. Good job! Now how do you save this to your codespace?

    Did you already look here for a thread called Embedded String in your code space?
    See the short story there http://www.pbpgroup.com/modules/wfse...p?articleid=10

    Easier does it?
    In fact it's possible to use any character using a 5bits coding:

    Since A-Z is only 26 letters, the 5 bits coding has a remaining 5 position to be used as controls like bellow:

    I prefer to use the default as a lower case chars. (abcdef...)
    So A-Z are coded as a=1, b=2, c=3, d=4...till z=26

    As controls I use:
    0 - End of string
    27 - Space char
    28 - Begin/End mark for a upper case string
    29 - Begin/End mark for numbers 0-9
    30 - Begin/End mark for symbols +-,.!$%^ (max 26 symbols each one is a char A-Z)
    31 - Reserved, I have in nothing in mind in the moment :-)

    So I code the string this way:

    Source:
    "/t/hese /word/ is in upper case this year is [bjjf]"

    the ouput:
    "This WORD is in upper case this year is 2006"

    I am doing this ... errr... by hand :-) transforming the string directly to bits, it's a hell of work i know, I need just to create a program to translate the strings (Source above) to the bits and coded as i want.

    Well, this idea I took from the HTML format, so even with as little as 5 bits I can get any char in a compact size :-)
    Last edited by serandre; - 7th April 2006 at 02:36.

  3. #3
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    with the previous link, it will take the same code space (+/- few bytes) and you'll never have to translate your strings. Make things really much easy when you need to modify or add any strings.

    Another idea is to save your string (or part of) in the internal EEPROM. Using your method or a variant of will permit to store 256 character in the internal EEPROM. I don't know how your string eat space but it could work too.
    Last edited by mister_e; - 7th April 2006 at 06:07.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. Presetting Configuration Fuses (PIC Defines) into your Program
    By Melanie in forum FAQ - Frequently Asked Questions
    Replies: 82
    Last Post: - 15th December 2013, 09:54
  2. Replies: 1
    Last Post: - 23rd May 2009, 09:22
  3. How much code space do PBP statements use.
    By Darrel Taylor in forum Code Examples
    Replies: 5
    Last Post: - 13th February 2009, 21:31
  4. Making Program Code Space your playground...
    By Melanie in forum Code Examples
    Replies: 15
    Last Post: - 19th July 2008, 08:26
  5. PIC16F684 Program question
    By Nicholas in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 28th December 2006, 14:30

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