Embedded Strings in your Code Space


Results 1 to 40 of 50

Threaded View

  1. #36
    Join Date
    Oct 2005
    Posts
    35


    Did you find this post helpful? Yes | No

    Question

    Using pin 25 RC6/TX and monitoring with MCS serial communicator at 9600 baud I get a repeating string of garbage characters. Hserout ["hello"] test result was the same. Isn't there an issue with hserout and inverted output?

    In the mean time playing around I found this code works:


    StringOut: ' Send the string out via serout
    Readcode Addr, TwoChars ' Get the 14 bit packed characters
    Char = TwoChars >> 7 ' Separate first char
    if Char = 0 then StringDone ' Look for Null char, Stop if found
    Gosub Out ' Send first char
    Char = TwoChars & $7F ' Separate second char


    if Char = 0 then StringDone ' Look for Null char, Stop if found
    Gosub out ' Send the second char
    Addr = Addr + 1 ' Point to next two characters

    Goto StringOut ' Continue with rest of the string

    StringDone:
    Return

    out:
    Serout PORTE.1,N2400,[char]:Return
    end

    I'm trying to find a way to select ASCI character tag pairs based on a numerical index something like my flawed example below.

    Lookup index,["A1","A2","A3","A4","B1","B2","B3","B4"....... ..],#tag

    I can use codespace strings if there is no simpler way to go.
    Last edited by Homerclese; - 9th March 2007 at 20:02.
    Thanks,
    Homerclese

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