transfer a string from ROM to an array


Results 1 to 40 of 45

Threaded View

  1. #28
    Join Date
    May 2013
    Location
    australia
    Posts
    2,654


    Did you find this post helpful? Yes | No

    Default Re: transfer a string from ROM to an array

    buffer does not actually exist its just a label in the macro , when assembled
    @ Flash2Ram _buff , _String1 , produces


    Code:
    000168 0E00               M    movlw   UPPER _String1
    0016A 6EF8                 M    movwf   TBLPTRU
    00016C 0E01               M    movlw   HIGH _String1
    00016A 6EF8               M    movwf   TBLPTRU
    00016C 0E01               M    movlw   HIGH _String1
    00016E 6EF7               M    movwf   TBLPTRH
    000170 0E3E               M    movlw   LOW _String1
    000172 6EF6               M    movwf   TBLPTRL
    000174 0E1A               M    movlw   low _buff            
    000176 6ED9               M    movwf   FSR2L
    000178 0E00               M    movlw   High _buff
    00017A 6EDA               M    movwf   FSR2H
                              M    L?CALL  _bfill
    the label "buffer" is replaced with the symbol of the intended target
    at no stage do we actually write directly to the "buffer" we simply load its address (from the symbol table) into the fsr regs
    the bfill subroutine then fills the "buffer" indirectly via the fsr regs
    macro's are not subroutines they are just another shortcut way to save typing, every time the macro is encountered the real code as above is inserted into your program
    Last edited by richard; - 20th April 2015 at 14:31.

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