This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

A bizarre jump with AM3358

Other Parts Discussed in Thread: AM3358

Hi, 

When I run the following code with AM3358 Starter Kit, it does not go sequentially after $1 line (see red line below). It jumps to a line like:

Label1: .asmfunc
asmfunc1: CMP r1, #0 ; Compare r1 to zero.
BCS $1 ; If carry is set, branch to $1;
ADDS r0, r0, #1 ; else increment to r0
MOVCS pc, lr ; and return.
$1: LDR r2, [r5]
LDR r2, [r5], #4 ; Load indirect of r5 into r2
; with write back.
.newblock ; Undefine $1 so it can be used
; again.
ADDS r1, r1, r2 ; Add r2 to r1.
BPL $1 ; If the negative bit isn't set,
; branch to $1;
MVNS r1, r1 ; else negate r1.
$1: MOV pc, lr ; Return.
.endasmfunc

 

Does the mode have to be set for A8? The above asm function is called in a .c file.

 

If I run TI simulator as Debug Target (Only Arm A926 can be selected. There is no A8 CPU in simulator), debug behaves correctly to the following lines after red line.

 

Could you help me the above question?

 

Thanks,