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.

TMS320F28379D: Questions about the assembly code "MOV"

Part Number: TMS320F28379D

Hi, I have a question about the assembly code on TMS320F28379D. I added my code on the example project names "blinky_cpu01".

And the main file's code is shown below

#include "F28x_Project.h"
extern void test_MOV();
uint32_t test_num = 1;
void main(void)
{
    InitSysCtrl();
    InitGpio();
    GPIO_SetupPinMux(31, GPIO_MUX_CPU1, 0);
    GPIO_SetupPinOptions(31, GPIO_OUTPUT, GPIO_PUSHPULL);
    DINT;

    InitPieCtrl();
    IER = 0x0000;
    IFR = 0x0000;
    InitPieVectTable();
    EINT;  // Enable Global interrupt INTM
    ERTM;  // Enable Global realtime interrupt DBGM
    test_MOV();
    for(;;)
    {
        GPIO_WritePin(31, 0);
        DELAY_US(1000*500);
        GPIO_WritePin(31, 1);
        DELAY_US(1000*500);
    }
}

The "test_MOV()" is defined in another asm file and the code is 

	.ref _test_num
	.def _test_MOV

_test_MOV:
    MOV     AR0, #_test_num
    MOV     AL, *AR0
    MOV     AR1, AL
	LRETR

The function of code should be moving test_num, which is 1 by initialization, into AR1.

However, After running this, AR1 is 0, which is not as expected. Could you please give me some suggestion about this problem? Thank you