transfer a string from ROM to an array


Closed Thread
Results 1 to 40 of 45

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default Re: transfer a string from ROM to an array

    a cleaned up version
    Attached Files Attached Files

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


    Did you find this post helpful? Yes | No

    Default Re: transfer a string from ROM to an array

    an even better way
    Attached Files Attached Files

  3. #3
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    84


    Did you find this post helpful? Yes | No

    Default Re: transfer a string from ROM to an array

    Hi again,
    thanks for the cleaned and full working sample.
    I'm much scared about "its not interrupt proof , other pbp functons may and do use FSR2 and TBLPTR" ....
    I'll try to ask Melabs if it's safe or not.
    Marco

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


    Did you find this post helpful? Yes | No

    Default Re: transfer a string from ROM to an array

    marco
    I will give you three options
    1. intcon.7=0 ' I'm assuming it was set
    @ Flash2Ram _buff,_String1' Get a String from flash memory
    intcon.7=1
    2 . examine your .lst file and determine if any of your isr routines use FSR2 or TBLPTR
    if none of them do then don't worry (this is the most likely case)
    3. there are two other indirect addressing pointers FSR0 and FSR1 maybe one of them would be free

    as groucho would say if you don't like these I have others

    this is the best I can offer without seeing your code

  5. #5
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,621


    Did you find this post helpful? Yes | No

    Default Re: transfer a string from ROM to an array

    Hi,
    Looking at the DT-INTS_18 file Darrel is declaring variables for saving the FSR's:
    Code:
    fsave0H     var WORD  BANK0  SYSTEM   ' locations for FSR registers
    fsave1H     var WORD  BANK0  SYSTEM
    fsave2H     var WORD  BANK0  SYSTEM
    fsave0L     var WORD  BANK0  SYSTEM   ' low priority FSR locations
    fsave1L     var WORD  BANK0  SYSTEM
    fsave2L     var WORD  BANK0  SYSTEM
    There's also a section towards the end that says
    Code:
    ; ---[See if we need to save TBLPTR]------------------------------------------
    Which sets a flag SAVE_TBLPTR = 1 when any PBP command that uses TBLPTR is used and in the ReEnterPBP-18 file he's declaring variables for TBLPTR like:
    Code:
        TBLPTRU_H     VAR HP_Vars[31]
          TBLPTRU_SaveH VAR TBLPTRU_H.lowbyte
        TBLPTR_H      VAR HP_Vars[32]
          TBLPTRH_SaveH VAR TBLPTR_H.highbyte
          TBLPTRL_SaveH VAR TBLPTR_H.lowbyte
    And then, further down in that file:
    Code:
    @ if Save_TBLPTR == 1
        TBLPTRU_SaveH = TBLPTRU
        TBLPTRH_SaveH = TBLPTRH
        TBLPTRL_SaveH = TBLPTRL
    @ endif
    So, to me, it looks like DT-INTS is handling all that stuff and you would/should only need to worry about it of you're using the FSR's or TBLPTR in any other ASM routines which would mean that DT-INTS does't detect them being used and therefor doesn't save them.

    Of course I may have it all wrong in which case I hope someone who can understand the ASM in DT-Ints better then me can explain what's going on.

    /Henrik.

  6. #6
    Join Date
    May 2013
    Location
    australia
    Posts
    2,680


    Did you find this post helpful? Yes | No

    Default Re: transfer a string from ROM to an array

    thanks for that henrik I never thought to look at how dt ints works . dt's code leaves nothing to chance ,I'm left humbled again

  7. #7
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    84


    Did you find this post helpful? Yes | No

    Default Re: transfer a string from ROM to an array

    Guys,
    about Darrel code I could put my hand on fire.
    about my code I can bet there are bugs ...
    but with your help now I have everything clear and know where problems can be or not. I have DTint and other ISR where I'll take care about FSR and TBLPTR.
    so, many thanks again for your support !
    bye
    Marco

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