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

Version 4.088 error?

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



Joined: 25 Jun 2009
Posts: 7

View user's profile Send private message

Version 4.088 error?
PostPosted: Mon Jul 20, 2009 8:16 am     Reply with quote

Nomber one:

Code:

#include <18F2580.h>
//******************************************
int32 MY_STATE;

#define GET_MY_STATE(x)   bit_test(MY_STATE,x)
#define SET_MY_STATE(x,y) {if(y) bit_set(MY_STATE,x); else bit_clear(MY_STATE,x);}

#define MY_STATE0    0
#define MY_STATE1    1
#define MY_STATE2    2
#define MY_STATE3    3
#define MY_STATE4    4
#define MY_STATE5    5
#define MY_STATE6    6
#define MY_STATE7    7
#define MY_STATE8    8
#define MY_STATE9    9
#define MY_STATE10   10
#define MY_STATE11   11
#define MY_STATE12   12
#define MY_STATE13   13
#define MY_STATE14   14
#define MY_STATE15   15
#define MY_STATE16   16
#define MY_STATE17   17
#define MY_STATE18   18
#define MY_STATE19   19
#define MY_STATE20   20
#define MY_STATE21   21
#define MY_STATE22   22
#define MY_STATE23   23
#define MY_STATE24   24
#define MY_STATE25   25
#define MY_STATE26   26
#define MY_STATE27   27
#define MY_STATE28   28
#define MY_STATE29   29
#define MY_STATE30   30
#define MY_STATE31   31
//******************************************

void main(){
   int8 i;
   
   SET_MY_STATE(MY_STATE0,bit_test(i,0))

}



Version 3.249

Code:

....................    SET_MY_STATE(MY_STATE0,bit_test(i,0))
0014:  BTFSS  09.0
0016:  BRA    001C
0018:  BSF    05.0
001A:  BRA    001E
001C:  BCF    05.0


Version 4.088

Code:

....................    SET_MY_STATE(MY_STATE0,bit_test(i,0))
0014:  BTFSS  09.0
0016:  BRA    001C
0018:  BSF    05.0
001A:  BRA    0020
001C:  BCF    05.0
001E:  BCF    08.7



The last command in v4.088 is errorius. This command corrupt highest data bit in MY_STATE any time when i call SET_MY_STATE(x,y) with not constant 'y'.


Nomber two:
file 18F2580.h

Version 3.249
Code:

#define INT_RB                    0xF208


Version 4.088
Code:

#define INT_RB                    0xFFF208
Ttelmah
Guest







PostPosted: Mon Jul 20, 2009 8:50 am     Reply with quote

Read the heading of the forum. To report faults, talk to CCS...
The INT definition, is _not_ an error. CCS added extra bits to the definition, to support chips with other features. These are the extra bytes in the definition.
Double check what compiler mode you are in. BIT 7, or the top byte, may be set, if the int32 type, is set as 'signed'. This is the default, if in ANSI mode for example.

Best Wishes
qseeker



Joined: 25 Jun 2009
Posts: 7

View user's profile Send private message

PostPosted: Mon Jul 20, 2009 9:13 am     Reply with quote

Thank you, Ttelmah!
I don't sure about compiler error. I just to find out it. The INT defintion is clear for me now, thank you again. I tryed signed and unsigned int32 types without results. On signed and unsigned int16 in v.4 work correct.
qseeker



Joined: 25 Jun 2009
Posts: 7

View user's profile Send private message

PostPosted: Tue Jul 21, 2009 6:35 am     Reply with quote

Only MY_STATE&=MASK instead of bit_clear() help me solve this problem.
Somebody have same problem with bit_clear(x,y) on int32 'x' with not constant 'y'?
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