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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
05/15/09 16:29
Read: times


 
#165387 - not really applicable
Responding to: ???'s previous message
Neil Kurzman said:
Many compilers use const instead of code.

Actually, most compilers don't have a 'code' keyword.

'const' is a standard keyword, and the standard notes that it may be used to identify items for non-volatile storage.

'code' is a proprietary extension to accomodate the fact that the 8051 architecture has a distinct CODE address space.

It would not be very useful for an 8051 compiler to use 'const' to mean CODE space, because you might also want to qualify things in other memory spaces as 'const' - in particular, if you had some non-volatile memory mapped into XDATA space (or, perhaps, a read-only XDATA-mapped peripheral)

(In fact, Keil does have a facility to load 'const xdata' items into the Hex file so that they can be programmed into a PROM mapped into XDATA space)

List of 25 messages in thread
TopicAuthorDate
C lang. question            01/01/70 00:00      
   Confused            01/01/70 00:00      
      re:            01/01/70 00:00      
         Did you get the job?            01/01/70 00:00      
            Do you _want_ the job?            01/01/70 00:00      
               Same same            01/01/70 00:00      
                  Yes, that was exactly what I meant!            01/01/70 00:00      
            re:job            01/01/70 00:00      
            OR            01/01/70 00:00      
               I wouldn't have thought so?            01/01/70 00:00      
                  Who knows            01/01/70 00:00      
                     not really applicable            01/01/70 00:00      
                        I agree            01/01/70 00:00      
                           Still missing the point.            01/01/70 00:00      
                              using 'const' for 'code' would be very bad            01/01/70 00:00      
                              Two examples            01/01/70 00:00      
                                 Different issues            01/01/70 00:00      
                                    architectual            01/01/70 00:00      
                                       Actually irrelevant to the const keyword            01/01/70 00:00      
                                          if it is irrelevant, then why ...            01/01/70 00:00      
                                             Because they are not equivalent            01/01/70 00:00      
                                          Exactly.            01/01/70 00:00      
                                             Standard mechanisms for extensions            01/01/70 00:00      
      volatile applies to data - not functions            01/01/70 00:00      
   Delay loops in 'C' (or any other HLL)            01/01/70 00:00      

Back to Subject List