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.

Compiler/TMS320F28335: Question about terms and usage.

Part Number: TMS320F28335

Tool/software: TI C/C++ Compiler

Hi,

The title was implied because of several different questions.
Please understand.

1. General purpose registers are from XAR0 to XAR7.
Is there a characteristic for each register?

For example, XAR4 registers are used for some specific operations.
I wonder if there is a "some specific" definition.

2. Using cg_xml, I checked the stack usage through the call_graph.pl file.
I wonder what the wcs appearing in the call graph means,
Is it correct to indicate how many addresses the stack uses?
For example, if func1 wcs = 20, it means 20 addresses, and since it has 2 bytes per address, does it mean 40 bytes?

3. Can you show me an example of inline assembly code to operate a PC?

Thanks, Regards

Han

  • Han,

    1. XAR0-7 are a set of 32-bit Auxiliary Registers. Typically they would hold data addresses, though they could be used for other purposes too. In this sense you could think of them as "General Purpose" registers, though I don't know anywhere in the documentation they are called that.

    Certain assembly instructions will assign a specific task to one of the registers. For example, the PREAD instruction always uses XAR7 for program memory address indexing. Also, in function calls some of the registers are used for passing arguments. Otherwise there is nothing specific about them.

    2. I don't know about this subject. Someone else on the forum will have to respond.

    3. Please could you elaborate on what you mean by "operate a PC"?   You previously raised a possibly related question here:
    https://e2e.ti.com/support/microcontrollers/c2000/f/171/t/895060
    I'm not sure what you are asking.

    Thanks.

    Regards,

    Richard

  • Richard,

    Nice to see you again.

    1. "the PREAD instruction always uses XAR7 for program memory address indexing", As you said earlier, is there an example where each register has its own unique features, XAR0 through XAR6?

    Or should I think that when computing, the CPU uses XARn registers that it doesn't use at the moment?

    2. Okay, Thanks

    3. You showed me an example of assembly code that can manipulate RPC registers.

    I asked if you could show an example of the assembly code of a PC like RPC registers.

    Sorry for the hassle.

    Thanks, Regards

    Han

  • I have another question.

    I am looking at this code and assembly.

    int buffer[10]={65,65,65,65,65,65,65,65,65,65};

    --------------------------------------------------------------

    0000a279   76c0    MOVL XAR7, #0x00e2e0 // (0x00e2e0 locate stored 65, 65, 65, 65, 65, 65, 65, 65, 65, 65) total 10
    0000a27a   e2e0               
    0000a27b   f609     RPT #9    //  ( repeat the next instruction 9 times then.)  <- why repeat 9 times? not 10 times?
    0000a27c   2484    ||PREAD *XAR4++, *XAR7 // ( transfer *XAR7 (65) -> *XAR4 address

    what is "||" that front of PREAD?

    and, PREAD definition is 

    PREAD = "This instruction reads a data value rather than an instruction from program space. It then transfers that value to data space or a register

    * The 0x00e2e0 area indicated by XAR7 is an econst area and a data area in my environment.

    I think it's different from the above definition, is it something I don't understand?

    if something is data in the program area, something means that the const value may be correct, but in my environment, const exists in the data area, not the program area.

    /* Data Memory. */
    PAGE 1 :
    BOOT_RSVD : origin = 0x000002, length = 0x00004E /* Part of M0, BOOT rom will use this for stack. */
    RAMM1 : origin = 0x000400, length = 0x000400
    PIE_VRAM : origin = 0x000D00, length = 0x000100
    RAMLD : origin = 0x00D000, length = 0x001000
    RAMLE : origin = 0x00E000, length = 0x001000
    RAMLF : origin = 0x00F000, length = 0x001000

      .econst    : > RAMLE,           PAGE = 1 /* Constant data

    Thanks,

    Regards

    Han

  • Han,

    The || are sometimes called "pipes" and in C28x asm are what is used to tell the assembler what instruction will be repeated.  Note that since the instruction PREAD #### is executed once by default this is the reason the RPT ## is one less than what is desired.  I beleive the seciton in the C28x instruction set on the RPT instruction gives a list of repeatable instructions(not all are).

    Finally, something special about an instruciton that is repeated is that it cannot be interrupted until all repeats are complete, it is pipeline protected in this fashion.

    Best,

    Matthew