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.

Syntax Error in Inline Assembly Language (TMS320F28069 and CCS v5.5)

Hi.

I'm working/experimenting with a simple demo program:

A C-written ISR from within I need to read out all the register contents from the stack performed by the (newly/last occurred) automatic context save (during the "Standard operation for CPU maskable interrupt"). I tried the following ASM-inline code:

. . .
	if (taskNo & 1)
	{
		// Read registers from the stack
		__asm(" DINT");
		__asm(" POP XT");
		__asm(" POP XAR7");
		__asm(" POP XAR6");
. . . 

The ASM-listing/expansion looks like:

_clk_ISR:
	.dwcfi	cfa_offset, -2
	.dwcfi	save_reg_to_mem, 26, 0
	.dwcfi	save_reg_to_reg, 78, 26
	.dwpsn	file "../tasks.c",line 93,column 2,is_stmt
        MOVB      ACC,#1                ; [CPU_] |93| 
        MOVW      DP,#_taskNo           ; [CPU_U] 
        ADDL      @_taskNo,ACC          ; [CPU_] |93| 
	.dwpsn	file "../tasks.c",line 95,column 2,is_stmt
        TBIT      @_taskNo,#0           ; [CPU_] |95| 
        BF        $C$L6,NTC             ; [CPU_] |95| 
        ; branchcc occurs ; [] |95| 
	.dwpsn	file "../tasks.c",line 99,column 3,is_stmt
 DINT
	.dwpsn	file "../tasks.c",line 101,column 3,is_stmt
 POP XT
	.dwpsn	file "../tasks.c",line 102,column 3,is_stmt
 POP XAR7
	.dwpsn	file "../tasks.c",line 103,column 3,is_stmt
 POP XAR6
	.dwpsn	file "../tasks.c",line 113,column 2,is_stmt
        B         $C$L6,UNC             ; [CPU_] |113| 
        ; branch occurs ; [] |113| 
$C$L6:    

And give me the following ERRORS for all the asm inline statement (DINT and POP ...): "[E0003] Syntax error - Operand 1"

Why?

I see that the ASM-listing shows:  ".dwpsn file "../tasks.c",line 100,column 3,is_stmt".

Why does is says "column 3" (shouldn't it be column 2) ?

 

Best Regards

Terje Bøhler

  • Depending on the version of the compiler, you must add the -v28 option to the compiler for it to accept C28x-specific opcodes. When I do that, old versions of the compiler/assembler accept these __asm statements. What version of the compiler are you using? (It is not the same as the CCS version.)

    The .dwpsn is supposed to reflect the line and column of the C source line. I can't quite tell from your C snippet whether these values are correct.