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/TMS320C6678: Hybrid programming,assembly,C language

Part Number: TMS320C6678


Tool/software: TI C/C++ Compiler

hello

I have a problem.

I tried to call the assembly file in C, Success without SYS/BIOS, but It's not successful in SYS/BIOS, 

The following error occurred while I was running to the assembly function called.

This is assembly :

thank you!

  • Hi,

    Verify to be compliant to the EABI as per TI SPRAB89A C6000 Embedded Application Binary Interface.
    For instance, You have to preserve A10-A15, B10-B15, A2 (see §3.2). Also it seems to me that your routine miss the return statement"B B3" (followed by a NOP 5).
    Note that the behaviour can depend on the caller: if it does not use A11:A10, you routine could seem to work fine.
    I also suggest to You tu use .asmfunc/.endasmfunc to mark the begin and end of assembler function (nicer for the debugger and mix asm/C).
  • HI,
    Alberto Chessa.
    I'm sorry to be back so late.
    thank you very much for your answer and suggestion.
    I have run successfully.
    best Regards.

    Attach my successful assembly code

    .global sum
    ;A4 B4 A6 is src, B6 is dst
    ;MVK .L1 500,B1
    ; loop:
    .asmfunc
    sum:
    MVK .L1 2,A3
    MV .L2X A8,B1

    loop:
    LDDW .D1 *A4++[1],A9:A8
    || LDDW .D2 *B4++[1],B9:B8

    LDDW .D1 *A6++[1],A1:A0
    NOP 4

    DMPYSP .M2X A9:A8,B9:B8,B9:B8

    || DMPYSP .M1 A9:A8,A1:A0,A1:A0

    NOP 4
    DADDSP .L1X B9:B8,A1:A0,A1:A0
    NOP 2

    STDW .D2 A1:A0,*B6++[1]

    SUB .L2X B1,A3,B1
    [B1] B .S1 loop

    NOP 5
    B B3
    .endasmfunc