Handling of strings communicating with cortex arm M3 and M4

0

The following code is supposed to add a "CD" string to another "AB" but it does not seem to be expected.

func_3                              ;void *memcpy(void *dest, const void *src size_t n)
<code>
ALIGN
func3_string1 DCB "AB",0x00         ;String1
func3_string2 DCB "CD",0x00         ;String2
STRING3 SPACE 50

    LDR R0, =func3_string1
    LDR R1, =func3_string2
    LDR R3, =STRING3

func3_write1                     ;Le e escreve "AB"
    LDRB R4, [R0], #1
    STRB R4, [R3], #1
    CMP R4, #0x00
    BNE func3_write1

func3_write2                      ;Le e escreve "CD"
    LDRB R4, [R1],#1
    STRB R4, [R3],#1
    CMP R4, #0x00
    BNE func3_write2

    B stop
    
asked by anonymous 06.06.2018 / 16:53

0 answers