transfer a string from ROM to an array


Closed Thread
Results 1 to 40 of 45

Hybrid View

  1. #1
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,624


    Did you find this post helpful? Yes | No

    Default Re: transfer a string from ROM to an array

    I think it might have something to do with the number of bytes (odd or even) in the string.
    In both of Richards examples there's an even number of bytes (16 and 22) but your Hello string there's an odd number of bytes (5). I seem to remember an issue with this being discussed in one of the 'Strings in codespace' threads some years ago.

    /Henrik.

  2. #2
    Join Date
    May 2013
    Location
    australia
    Posts
    2,692


    Did you find this post helpful? Yes | No

    Default Re: transfer a string from ROM to an array

    odd length strings , wastes space but not a problem


    00013E 6854 7369 6920 00199 data "This is a string1",0
    2073 2061 7473
    6972 676E 0031
    0000

    00013E 6854 7369 6920 00199 da "This is a string1",0
    2073 2061 7473
    6972 676E 0031
    0000

  3. #3
    Join Date
    May 2013
    Location
    australia
    Posts
    2,692


    Did you find this post helpful? Yes | No

    Default Re: transfer a string from ROM to an array

    00013E 6548 6C6C 006F 00199 da "Hello",0
    0000

  4. #4
    Join Date
    May 2013
    Location
    australia
    Posts
    2,692


    Did you find this post helpful? Yes | No

    Default Re: transfer a string from ROM to an array

    there's another little cheat if all the strings are odd length the 0 terminator is redundant

Similar Threads

  1. String of characters(array) to decimal value
    By tacbanon in forum mel PIC BASIC Pro
    Replies: 20
    Last Post: - 20th June 2012, 15:30
  2. Replies: 3
    Last Post: - 3rd December 2011, 23:48
  3. Array of string to send with TX int ?
    By amgen in forum General
    Replies: 18
    Last Post: - 18th August 2011, 17:56
  4. How to send a string with another string inside it?
    By financecatalyst in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 13th May 2011, 18:11
  5. Manipulation of string array
    By Benny007 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 23rd April 2008, 21:50

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