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.

CCS/TMS320F28377S: indirect address mode

Part Number: TMS320F28377S

Tool/software: Code Composer Studio

If the indirect addressing mode is used, how to assign the starting address of the global array defined by the C language program to the auxiliary register? For example, the array Uint32 Xp [80] is defined in C program. Because Xp is a pointer variable, my understanding is to assign the starting address of the array to the auxiliary register XAR5 with the following statement:

       MOVW   DP,   #_Xp

       MOVL   XAR5,   @_Xp

Then access the data Xp [60] through the following statements:

       MOV   @AR0,   #60

       ADDUL   ACC,   *+XAR5[AR0]

Is the assembly statement correct? When addressing indirectly with XAR5 auxiliary registers, do I need to set the ARP field to 5 in the program?

If multiple auxiliary registers are used to address at the same time, how to set the value of the field ARP?

  • Your understanding is correct, as is the assembly code in your post.  On C28x, you do not need to worry about the ARP field.  That is there for legacy reasons because the core still supports C24x object code where the ARP was used.  On C28x you can use multiple XAR registers to address the same data.  For example, this is legal:

    MOV   @AR0,   #60

    ADDUL   ACC,   *+XAR2[AR0]

    ADDUL   ACC,   *+XAR5[AR0]

    ADDUL   ACC,   *+XAR3[AR0]

    Regards,

    Richard