Embedded Strings in your Code Space


Results 1 to 40 of 50

Threaded View

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


    Did you find this post helpful? Yes | No

    Default

    mmm, another solution...
    Code:
    String1 da "My string",13,10,"blah blah",13,10,125,126,127,0
    Just modify a little bit the StringOut Sub
    Code:
    StringOut:  ' Send the string out via Hserout
        Readcode Addr, TwoChars       ' Get the 14 bit packed characters
        Char = TwoChars >> 7          ' Separate first char
        if Char then                  ' Look for Null char, Stop if found
           hserout [Char]             ' Send first char
           endif
    
        Char = TwoChars & $7F         ' Separate second char
        if Char then                  ' Look for Null char, Stop if found
           hserout [Char]             ' Send the second char
           Addr = Addr + 1            ' Point to next two characters
           goto StringOut	          ' Continue with rest of the string
           endif
    return
    that way it works. BUT it don't take all the advantage of the 14 BIT pack stuff. It's just more readable the the previous.
    Last edited by mister_e; - 27th August 2005 at 21:21.
    Steve

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

Similar Threads

  1. Minimizing code space
    By Tobias in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 30th May 2009, 07:25
  2. How much code space do PBP statements use.
    By Darrel Taylor in forum Code Examples
    Replies: 5
    Last Post: - 13th February 2009, 21:31
  3. Loop with two motor and 2 sensors
    By MrRoboto in forum mel PIC BASIC
    Replies: 4
    Last Post: - 8th December 2008, 23:40
  4. Making Program Code Space your playground...
    By Melanie in forum Code Examples
    Replies: 15
    Last Post: - 19th July 2008, 08:26
  5. Please help with storing strings in codespace
    By g-hoot in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 16th May 2008, 01:02

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