CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

New PCD bug in V4.087

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

New PCD bug in V4.087
PostPosted: Sun Mar 15, 2009 10:58 am     Reply with quote

Although PCD V4.087 has been released with the statement "A number of PCD issues have been resolved", it's apparently introducing new surprizing bugs with int1 variables. I use #bit notation to assign different variable addresses, the problem also occurs with variable declared as int1 or int1 members of structures above address 0x1000.

Code:
#include <24FJ128GA106.h>

#bit b1 = 0xFF0.3
#bit b2 = 0x1000.3

void main(void)
{
   if (b1) b1=0;
   if (b2) b2=0;
}


While b1 is treated as with previous versions, the b2 access is compiled incorrectly see below, b2 is treated as an int1* pointer. No idea, what the programmers tried to achieve here. As a result, PCD V4.087 is unusable, if data space above 0x1000 is populated with any int1 vars. A dummy (int1) type cast can be workaround, but not a serious solution of course, cause it would have to be applied to hundreds of int1 instances.

.................... if (b1) b1=0;
0020C: BTSS.B FF0.3
0020E: BRA 212
00210: BCLR.B FF0.3
.................... if (b2) b2=0;
00212: MOV 1000,W4
00214: MOV [W4],W4
00216: BTSS W4.3
00218: BRA 21C
0021A: BCLR.B 1000.3
n-squared



Joined: 03 Oct 2006
Posts: 99

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Sun Mar 15, 2009 1:01 pm     Reply with quote

The code looks correct to me. It is using W4 as a pointer AND later as a temporary accumulator, but tests the actual contents of 0x1000.3.
The problem with this code is that it uses two more instructions to execute. Just like you said - makes no sense.
The guys at CCS still have a long way to go before PCD is a serious product.
I just saw on Microchip web site an announcement of purchasing HI-TECH. I expect they will provide the best of both. If only they had all the libraries of CCS...
_________________
Every solution has a problem.
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Sun Mar 15, 2009 1:46 pm     Reply with quote

Quote:
The code looks correct to me.
It isn't. The below code would be functional correct, the V4.087 code ist loading the content of address 0x1000 to W4 rather then the address value, in other words, it treats b2 as a pointer int1*.
Code:
MOV #1000,W4
MOV [W4],W4
BTSS W4.3

I never would have checked the code, if it works correctly. I was trying a small code change with newly installed V4.087 and experienced complete failure of a previously working application.
n-squared



Joined: 03 Oct 2006
Posts: 99

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Sun Mar 15, 2009 1:56 pm     Reply with quote

ah, you are right. I did not notice the omission of the # sign.
Sorry.
These guys keep reinforcing my saying that "every solution has a problem". They keep new problems while solving previous problems.
_________________
Every solution has a problem.
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Tue Mar 17, 2009 8:47 am     Reply with quote

CCS support told, the issue gonna be fixed in the next compiler release.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group