Please note: We are aware of an issue affecting replies on the Arm Community forums, which may not be loading as expected.

We apologize for any inconvenience and appreciate your patience while we investigate and work to resolve the issue.

Thank you for your understanding.


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

uVision4 Debugger's "Memory 1" Window doesn't show the updated value

I tried to write a simple program that can find the 1's complement of a number and store the result in memory.

This is my program:

;Find the one's complement (inverse) of a number

        TTL     Ch4Ex2 - invert
        AREA    Program, CODE, READONLY
        ENTRY

Main
        LDR     R1, Value       ; Load the number to be complemented
        MVN     R1, R1          ; take 1's complement of R1
        STR     R1, Result      ; Store the result
        SWI     &11

Value   DCD     &FF             ; Value to be complemented
Result  DCD     &ABCD1234       ; Storage for result

        END

When I ran the debugger, I used "Memory 1" window to check the content of Result. But the content of Result didn't change. It kept remained as 0xABCD1234. Can anybody tell me what did I do wrong here?

I am using Keil uVision4 and LPC2368 as my device.

Thank you,
Khai

Parents
  • You need to look at your ARM reference guide for details on that one.

    Esentially, the immediate data is contained within the instruction itself. The instruction and data fit into a 32 bit wide instruction - there are only a small proportion of those bits available for the immediate data.

    The following should work:

        LDR             R0,=Value
        MOV             R1,#0xFF       ; You can leave alone (data fits into instruction)
        STR             R1,[R0]
    
        LDR             R0,=Result
        MOV             R1,=0xABCD1234 ; Use a pseudo-op
        STR             R1,[R0]
    

Reply
  • You need to look at your ARM reference guide for details on that one.

    Esentially, the immediate data is contained within the instruction itself. The instruction and data fit into a 32 bit wide instruction - there are only a small proportion of those bits available for the immediate data.

    The following should work:

        LDR             R0,=Value
        MOV             R1,#0xFF       ; You can leave alone (data fits into instruction)
        STR             R1,[R0]
    
        LDR             R0,=Result
        MOV             R1,=0xABCD1234 ; Use a pseudo-op
        STR             R1,[R0]
    

Children
No data