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.

  • Resolved

CCS: Illegal register for conditional : [A6]ADD .L1 A5,A0,A4

Tool/software: Code Composer Studio

Good day!

I try to compile simple program: sum numbers at array only if current number (at array) >0.

But i can not complile code:

 .ref _c_int00     ;
_c_int00:	
 .data 
array1:	.int 2,-1,47,-99 
size	.set 4 

 .text 
	MVKL .S1 array1,A3 
	MVKH .S1 array1,A3

	MVK .S1 size,A2 
	MVK .S1 0,A0 
	MVK .S2	0,B2 
	MVK .S1 0,A6
	MVK .S1 0,A4
	MVK .S1 0,A5
LOOP:
	SUB .L1 A2,1,A2 ;A2 := A2 - 1
   ;	MVK .S2 -1,B3
	LDW .D1 *A3[A2],B2 
	NOP 4 
	CMPGT .L1 A5,0,A6 
	NOP 6
	[A6]ADD .L1 A5,A0,A4 
	NOP 5
	[A2]B .S1 LOOP 
	NOP 5

	ERROR!   at line 24: [E0003] Illegal register for conditional
		[A6]ADD .L1 A5,A0,A4 

I try many ways to fix this problem, but i can not do this.

If i change A6 to B2 (for example), it compiles well.

What i do wrong?

Thank you!

Target is: TMS320C6ZXX.

Code Composer 3.3.

  • Only certain registers can be used as the condition.  You don't say exactly which device you use.  I'll guess it is a TMS320C674x device.  For that family of devices, further detail is available in the Conditional Operations section of the C674x Instruction Set Guide.

    Thanks and regards,

    -George


    TI C/C++ Compiler Forum Moderator
    Please click This Resolved My Issue on the best reply to your question
    The CCS Youtube Channel
     has short how-to videos
    The 
    Compiler Wiki answers most common questions
    Track an issue with SDOWP. Enter your bug id in the Search box.

  • In reply to George Mock:

    Thank you!

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.