Hashim Salem
Hashim Salem

Reputation: 33

ARM Assembly: Concatenate 2 Strings from memory

SIMPLE ARM LANGUAGE, keep the answers simple please

    AREA one, CODE
        ENTRY
        LDR r0, =STRING1
        LDR r1, =STRING2
        LDR r3, =STRING3

`loop1` LDRB r4, [r0], #1
        STRB r4, [r3], #1
        CMP r0, #0x00
        BNE loop1

loop2   LDRB r4, [r1], #1
        STRB r4, [r3], #1
        CMP r1, #0x00
        BNE loop2

        LDRB r4, #0x00
        STRB r4, [r3]

        ALIGN
STRING1 DCB "This is a test string1"            ;String1
EoS1    DCB 0x00                                ;end of string1
STRING2 DCB "This is a test string2"            ;String
EoS2    DCB 0x00                                ;end of string2
STRING3 space 0xFF 
        END

Im trying to concatenate STRING1 and STRING2 and store result in STRING3 and also append NULL End Of String 0x00

Is this correct?

Upvotes: 3

Views: 5274

Answers (1)

user6095830
user6095830

Reputation: 11

you are getting 'NO write permission' because you must set the Memory Map in the Debug Tab of the Kiel simulator to Read/Write/Execute permission

Upvotes: 1

Related Questions