Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
02/26/11 11:12
Read: times


 
#181325 - Yes
Responding to: ???'s previous message
Yes, C++ have a different view of const, so a const-declared integer can be used like:
const int size=100;
unsigned char my_array[size];
But Keil C51 isn't a C++ compiler.

And an open question is still what a C++ compiler would do when getting a "code" keyword to force a storage location.

I'm not sure exactly what the Keil C51 compiler does - if Keil have given their compiler the "right" to assume that it knows the value of the const-declared character when generating the code or if it will have to perform a large number of movc a,@a+dptr - movc a,@a+pc would be more efficient but isn't applicable since we are talking about a single named object.

List of 15 messages in thread
TopicAuthorDate
Multiple public definitions in code banking            01/01/70 00:00      
   single const byte in code            01/01/70 00:00      
      The meaning of 'const' in ANSI 'C'            01/01/70 00:00      
         Yes            01/01/70 00:00      
            Keil C51 isn't a C++ compiler            01/01/70 00:00      
      Coding Standard Rules - Netrino            01/01/70 00:00      
         Rule #2 is a bit broken or at least incompletely formulated            01/01/70 00:00      
         issue with #define usage            01/01/70 00:00      
      extern const code declaration            01/01/70 00:00      
         Insufficient detail            01/01/70 00:00      
         Conceptually wrong            01/01/70 00:00      
            Thanks, it's working !            01/01/70 00:00      
               Why?            01/01/70 00:00      
                  correction            01/01/70 00:00      
   Fundamental 'C' programming error!            01/01/70 00:00      

Back to Subject List