transfer a string from ROM to an array


Results 1 to 40 of 45

Threaded View

  1. #10
    Join Date
    May 2013
    Location
    australia
    Posts
    2,632


    Did you find this post helpful? Yes | No

    Default Re: transfer a string from ROM to an array

    add this to your code
    ARRAYWRITE inbuff,3,,["123"]

    and then look at the lst file generated

    see how arraywrite works
    01487 LIST
    000004 C00C FFE9 01488 ARRAYWRITE movff R5, FSR0L ; Put the array pointer into FSR0
    000008 C00D FFEA 01489 movff R5 + 1, FSR0H
    00000C 6EEE 01490 movwf POSTINC0 ; Put the char into the array and bump up the address
    00000E CFE9 F00C 01491 movff FSR0L, R5 ; Save new pointer
    000012 CFEA F00D 01492 movff FSR0H, R5 + 1
    the array address goes in like this


    C:\PBP3\EXAMPLES\MARCICK.PBP 00074 ARRAYWRITE inbuff,3,,["123"]
    00192 ARRAYWRITENAME?B _inbuff
    M MOVE?CW _inbuff, R5
    M ifdef USE_LINKER
    M CHK?RP R5
    M movlw low (_inbuff)
    M movwf R5
    M movlw high (_inbuff)
    M movwf (R5) + 1

    you need to emulate this using your own vars don't use r5 of course


    interrupts will need to be disabled too


    ps the forum totally destroys white space you need to look at your xxx.lst file to make it out properly
    Last edited by richard; - 15th April 2015 at 13:49. Reason: clean up

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, 14:30
  2. Replies: 3
    Last Post: - 3rd December 2011, 22:48
  3. Array of string to send with TX int ?
    By amgen in forum General
    Replies: 18
    Last Post: - 18th August 2011, 16: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, 17:11
  5. Manipulation of string array
    By Benny007 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 23rd April 2008, 20: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