This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

String functions in relocatable code, string is fixed in memory

I have the following code:
strcat(tbuf,"\r\nSH B = ");

My program memory model is small so I can re-locate the code in any sector. Unfortunately "\r\nSH B = " is fixed at an absolute address. I can make it a variable, but I have tons of these messages already coded. Is there a way to direct the string functions to use the small memory model as well?

Parents
  • I'm not quite sure what you want to achieve. You wrote:

    My program memory model is small

    It means that all the code is near and all the data is near as well unless you explicitly specify otherwise. That is, strings are near too.
    You can relocate near data to a different segment and adjust DPPx registers accordingly. Read the compiler manual, section "Advanced Programming Techniques, Near Pointers" and the C166 instruction set manual, section "Addressing Modes".

    - Mike

Reply
  • I'm not quite sure what you want to achieve. You wrote:

    My program memory model is small

    It means that all the code is near and all the data is near as well unless you explicitly specify otherwise. That is, strings are near too.
    You can relocate near data to a different segment and adjust DPPx registers accordingly. Read the compiler manual, section "Advanced Programming Techniques, Near Pointers" and the C166 instruction set manual, section "Addressing Modes".

    - Mike

Children
No data