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 Reply Children
  • //Example of string being declared in code segment.
        AREA data1, DATA
    ADD1 EQU 0x1000000
    
    	AREA prog, CODE
    		ENTRY
    	EXPORT __main2
    __main2
    		LDR R1, = ADD1
    		LDR R2, =string
    		LDRB R3, [R2]
    stop    B stop
    string DCB "abcd"
    		END
    //Example of code being declared in Code segment
        AREA data1, DATA
    ADD1 EQU 0x1000000
    string DCB "abcd"
    	AREA prog, CODE
    		ENTRY
    	EXPORT __main2
    __main2
    		LDR R1, = ADD1
    		LDR R2, =string
    		LDRB R3, [R2]
    stop    B stop
    
    		END