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 55 matches
CCS Forum Index
Author Message
  Topic: Shift operation don't work
Mortenc

Replies: 13
Views: 20555

PostForum: General CCS C Discussion   Posted: Thu Oct 01, 2015 4:10 am   Subject: Shift operation don't work
Thanks for your very good explanations Ttelmah.
(I feel me a little stupid besides all clever people in this forum).
  Topic: Shift operation don't work
Mortenc

Replies: 13
Views: 20555

PostForum: General CCS C Discussion   Posted: Thu Oct 01, 2015 2:33 am   Subject: Shift operation don't work
RF_developer, I'm not sure I know what you mean, but C34 to C40 could be both negative and positive and these are not fixed, so the program must handle both negative and positive.
  Topic: Shift operation don't work
Mortenc

Replies: 13
Views: 20555

PostForum: General CCS C Discussion   Posted: Wed Sep 30, 2015 11:24 pm   Subject: Shift operation don't work
Thanks for your explanations.

I will try to make with your suggested macro.
  Topic: Shift operation don't work
Mortenc

Replies: 13
Views: 20555

PostForum: General CCS C Discussion   Posted: Wed Sep 30, 2015 2:52 pm   Subject: Shift operation don't work
I think you have misunderstand me.
I mean that CCS, when they make the compiler, should take care of negative shifts.
My example is simplified. In my real program there is a lot of shift like
val ...
  Topic: Shift operation don't work
Mortenc

Replies: 13
Views: 20555

PostForum: General CCS C Discussion   Posted: Wed Sep 30, 2015 1:13 pm   Subject: Shift operation don't work
Both variables, level and value in unsigned INT16.
I have tried signed INT16 both with same result.
My compiler version is 4.067

If I understand you right, a shift operation with negative count i ...
  Topic: Shift operation don't work
Mortenc

Replies: 13
Views: 20555

PostForum: General CCS C Discussion   Posted: Wed Sep 30, 2015 10:29 am   Subject: Shift operation don't work
Hi CCS forum,

I have a little problem with a simple shift operation which not work as it should.

Example:

#define C17 16
#define C35 -1

level = 50;
value = (C17 + ((level&32)>> ...
  Topic: Compiler precalculations
Mortenc

Replies: 14
Views: 20243

PostForum: General CCS C Discussion   Posted: Mon Aug 10, 2015 1:19 pm   Subject: Compiler precalculations
Thanks for your explanation of the problem Ttelmah.
I have just made the same calculations as were made in the excel document by another person. In the excel these calculation are tested and worked a ...
  Topic: Compiler precalculations
Mortenc

Replies: 14
Views: 20243

PostForum: General CCS C Discussion   Posted: Mon Aug 10, 2015 6:29 am   Subject: Compiler precalculations
Thanks for your responds.
All the pre-calculations is taken from an excel-document which is made with microprocessor friendly math like shift, AND, OR and some IF decisions.
These calculations shall ...
  Topic: Compiler precalculations
Mortenc

Replies: 14
Views: 20243

PostForum: General CCS C Discussion   Posted: Mon Aug 10, 2015 2:02 am   Subject: Compiler precalculations
Does any have an idea what can be done to come over the limit?


My #defines look like these.
Nothing seems to be wrong with the #defines, but when I get to about 60 defines of these, the compile ...
  Topic: Compiler precalculations
Mortenc

Replies: 14
Views: 20243

PostForum: General CCS C Discussion   Posted: Fri Aug 07, 2015 4:27 am   Subject: Compiler precalculations
Could it be my large amount of #defines?
I have about 100 defines.
My compiler version is: PCM compiler 4.067
  Topic: Compiler precalculations
Mortenc

Replies: 14
Views: 20243

PostForum: General CCS C Discussion   Posted: Fri Aug 07, 2015 2:56 am   Subject: Compiler precalculations
I have tried to make it like you said, using #elif and place text like your example, but the same happen.
I have more of these "if" defining and the compiling go fine, but it seems too, tha ...
  Topic: Compiler precalculations
Mortenc

Replies: 14
Views: 20243

PostForum: General CCS C Discussion   Posted: Fri Aug 07, 2015 1:19 am   Subject: Compiler precalculations
Now I have made a lot of pre-calculation that the compiler shall do.
First the compiling suddenly going slow and when I add more calculations to do, the compiler freeze and don't get finish.
Does an ...
  Topic: Compiler precalculations
Mortenc

Replies: 14
Views: 20243

PostForum: General CCS C Discussion   Posted: Thu Aug 06, 2015 7:05 am   Subject: Compiler precalculations
Thanks it's a great forum.

I have a lot of pre-calculations to be done.
I must test every line a think, to be sure that all math I working.
  Topic: Compiler precalculations
Mortenc

Replies: 14
Views: 20243

PostForum: General CCS C Discussion   Posted: Thu Aug 06, 2015 3:54 am   Subject: Compiler precalculations
Many thanks Ttelmah.
That was just what I need.
However I'm a little in doubt whether all math operations can be used in my define lines. In my example 1, the bitwise AND and division seems to work. ...
  Topic: Compiler precalculations
Mortenc

Replies: 14
Views: 20243

PostForum: General CCS C Discussion   Posted: Thu Aug 06, 2015 2:01 am   Subject: Compiler precalculations
Can the compiler make some calculations of fixed values related to other fixed values so I don’t these calculation in the program?

Example 1:

#define version 0b0000000111110101
#define value_ ...
 
Page 1 of 4 Goto page 1, 2, 3, 4  Next
All times are GMT - 6 Hours
Jump to:  


Powered by phpBB © 2001, 2005 phpBB Group