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.

How to use the .mptr directive?

Hi,

Sorry for asking such a beginner's question, what are the two arguments the .mptr directive takes?

All TI documentation I've look at took a lot of text explaining what mptr is good for, however, not how it is used ;)

Thank you in advance, Clemens

  • Clemens,

    The following is directly from the C Compiler User's Guide.  

    _blkcp: .cproc I
    .reg ptr1, ptr2, tmp1, tmp2

    MVK 0x0, ptr1 ; ptr1 = address 0
    MVK 0x8, ptr2 ; ptr2 = address 8

    loop: .trip 50

    .mptr ptr1, a+0, 4
    .mptr foo, a+8, 4
    ; potential conflict
    LDW *ptr1++, tmp1 ; load *0, bank 0
    STW tmp1, *ptr2++{foo} ; store *8, bank 0

    [I] ADD -1,i,i ; I--
    [I] B loop ; if (!0) goto loop

    .endproc

    Hope this helps,

    Dan