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 CCS Technical Support

Odd addresses generated for PIC33F CLR instruction- OK?

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



Joined: 04 May 2010
Posts: 6

View user's profile Send private message

Odd addresses generated for PIC33F CLR instruction- OK?
PostPosted: Sun May 09, 2010 11:41 pm     Reply with quote

Hi-
I am a dsPIC newbie, and have been trying to nail down the cause of a
restart loop in PCI33F code that I inherited. The ASM code that apparently
causes the reset is:

Code:

....................    gpsData.dateInfo.adjusted.time = 0;
009A4:  CLR     DDB
009A6:  CLR     DDD

Note that the operand addresses in both instructions are ODD.
Is an odd address legal in a CLR instruction?

Also, a different source line (if I read it right) is using even addresses
for the same variable:
Code:
....................    gpsData.dateInfo.adjusted.time = res;
01B86:  PUSH    F1C
01B88:  POP     DDA
01B8A:  PUSH    F1E
01B8C:  POP     DDC


I hate to suspect the compiler when I'm so new to dsPICs, but
this really looks odd (pun intended).
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Mon May 10, 2010 7:16 am     Reply with quote

Word accesses (e.g. CLR) to an odd address cause an address error trap with PIC24/dsPIC. As discussed in a previous
thread, you can enable a trap handler to visualize this kind of error (and even allow the code to continue, if meaningful at all).

http://www.ccsinfo.com/forum/viewtopic.php?t=36479
leporid



Joined: 04 May 2010
Posts: 6

View user's profile Send private message

Odd addresses generated for PIC33F CLR instruction- OK?
PostPosted: Mon May 10, 2010 1:57 pm     Reply with quote

Thanks, maybe an interrupt routine can help me learn more.
But the odd addresses seem like a real problem.
I have filed a bug report.
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