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

Search found 8 matches
CCS Forum Index
Author Message
  Topic: local & global variables
planet69

Replies: 6
Views: 9010

PostForum: General CCS C Discussion   Posted: Tue Nov 09, 2010 9:58 pm   Subject: local & global variables
Appreciate the feedback. enlightening.

Anyway, I've done some pretty large programs but always with some RAM to spare.
I guess my 'large programs' are not that 'large' after all.
Laughing

Th ...
  Topic: local & global variables
planet69

Replies: 6
Views: 9010

PostForum: General CCS C Discussion   Posted: Mon Nov 08, 2010 9:27 pm   Subject: local & global variables
Why do we need to have separate local & global variables.

I've completed several programs without ever declaring any local variables and everything as globals.
I avoid any 'conflict' that may ...
  Topic: unable to declare a function
planet69

Replies: 3
Views: 4840

PostForum: General CCS C Discussion   Posted: Wed Nov 03, 2010 2:23 am   Subject: unable to declare a function
thanks
  Topic: unable to declare a function
planet69

Replies: 3
Views: 4840

PostForum: General CCS C Discussion   Posted: Tue Nov 02, 2010 9:04 pm   Subject: unable to declare a function
I'm using PCH v4.084.

Declaring the below function gives an error: "Expecting a basic type"
void buzzer_off (void);

Able to compile if I put it any other way
void buzzeroff ...
  Topic: divide by 10
planet69

Replies: 11
Views: 9120

PostForum: General CCS C Discussion   Posted: Wed Sep 08, 2010 7:34 pm   Subject: divide by 10
Wouldn't

remainder = numerator - (quotient * 10);


work faster as

remainder = numerator - (quotient * 8 + quotient * 2);


?

actually (quotient * 10) is few instr ...
  Topic: divide by 10
planet69

Replies: 11
Views: 9120

PostForum: General CCS C Discussion   Posted: Wed Sep 08, 2010 12:05 pm   Subject: Re: divide by 10

This annoys me greatly too, and I haven't found a solution. It's even more annoying when you analyse the generated code and find that they're identical, apart from where the two values are retrieved ...
  Topic: divide by 10
planet69

Replies: 11
Views: 9120

PostForum: General CCS C Discussion   Posted: Wed Sep 08, 2010 3:50 am   Subject: divide by 10
thanks PCM p. & Ttelmah

using mplab sim, i'm putting the codes into test.

i find that:
quotient = numerator / 10;
remainder = numerator % 10;
chows down approx. 195 instruction cycles and ...
  Topic: divide by 10
planet69

Replies: 11
Views: 9120

PostForum: General CCS C Discussion   Posted: Tue Sep 07, 2010 8:17 pm   Subject: divide by 10
Please show me a simpler way of implementing:

int8 quotient;
int8 remainder;
int8 numerator;

quotient = numerator / 10;
remainder = numerator % 10;

The two line generates an awful lot of a ...
 
Page 1 of 1
All times are GMT - 6 Hours
Jump to:  


Powered by phpBB © 2001, 2005 phpBB Group