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

LPC1768_Strings_assembly code

Hi, I'm working with LPC1768 MC & using the MDK simulator.  My assembly code is  involving strings. When I declare the string in data segment, it doesnt get reflected in memory window during the debug session. But if I declare the string in code segment, it gets reflected in the memory window during the debug session. Can anyone let me know, why this is happening?

Parents
  • I suspect that your memory window configuration is what's causing the issue. If I set the address of the memory window to r2 (which will take the value of register r2), then I see the correct strings when I step through the functions. I modified your code a little to make each function C callable, to better work with my existing project. For example, when stepping through the code, I see the following (once r2 has been set):

    Note also that if you want to define a C string you need to add the NULL terminator, e.g.,

    string DCB "c string",0

    This is explained in the armasm User Guide.

Reply
  • I suspect that your memory window configuration is what's causing the issue. If I set the address of the memory window to r2 (which will take the value of register r2), then I see the correct strings when I step through the functions. I modified your code a little to make each function C callable, to better work with my existing project. For example, when stepping through the code, I see the following (once r2 has been set):

    Note also that if you want to define a C string you need to add the NULL terminator, e.g.,

    string DCB "c string",0

    This is explained in the armasm User Guide.

Children
No data