View Single Post
  #22751    
Old September 17th, 2012 (4:14 AM).
sonic1's Avatar
sonic1 sonic1 is offline
ASM is my life now...
     
    Join Date: May 2008
    Location: Portugal
    Age: 22
    Gender: Male
    Nature: Timid
    Posts: 79
    Quote:
    Originally Posted by Chaos Rush View Post
    Does anyone know a simple ASM routine to change the value of an offset of your choice within the RAM?

    For instance, let's say I wanted to change the value at 0x02023BE4. How would I go about doing that?
    What do you mean actually? Like an WriteByteToOffset?
    Or a value that changes constantly?

    If the first one, it's as simple as this:

    Code:
    .align 2
    .thumb
    
    push {r0-r1,lr}
    ldr r0, =0xOFFSET
    ldr r1, =0xValue
    str r1, [r0]
    pop {r0-r1, lr}
    You must change That STR to STRB if the value is only 1 byte or to STRH if it's 2 bytes. Otherwise, it's 4 bytes and you leave it like it is.

    ~Sonic1
    __________________
    This signature has been disabled.
    over 350px high
    Please review and fix the issues by reading the signature rules.

    You must edit it to meet the limits set by the rules before you may remove the [sig-reason] code from your signature. Removing this tag will re-enable it.

    Do not remove the tag until you fix the issues in your signature. You may be infracted for removing this tag if you do not fix the specified issues. Do not use this tag for decoration purposes.