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

int1 not behaving correctly?

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



Joined: 25 May 2004
Posts: 25

View user's profile Send private message

int1 not behaving correctly?
PostPosted: Wed Jun 09, 2004 3:34 pm     Reply with quote

I saw a recent post about version 3.2xx having some wierd behavior with int1 and was wondering if it was also true for version 3.184. If I use this code:

int1 x;
main()
{
x = TRUE;
}

The debugger shows x as 0 all the time. I've tried x = 1, x == 1, x == TRUE. All 0. But if I define x as an int it will change value correctly/as expected.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Jun 09, 2004 4:14 pm     Reply with quote

Quote:
The debugger shows x as 0 all the time.

Look at the .LST file to find out what's really happening.
Here is part of the listing for your program, compiled
with PCM vs. 3.184 for a 16F877. Conclusion: No problem.
The variable x is being set = 1, as expected.

Code:
Symbol Table
x     00000020

0000                00284 .................... x = TRUE;   
000A 1283       00285 BCF    03.5      // Bank 0
000B 1420       00286 BSF    20.0      // Set bit 0 of Loc 0x20 = 1
ninjanick



Joined: 25 May 2004
Posts: 25

View user's profile Send private message

PostPosted: Thu Jun 10, 2004 1:45 pm     Reply with quote

I checked the LST file and it is getting set, but my Debugger still reads 0. Maybe it's a bug in the debugger?
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