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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
05/19/12 07:48
Read: times


 
Msg Score: +1
 +1 Good Answer/Helpful
#187429 - Separate "the C view of program" from "microcontroller view"
Responding to: ???'s previous message
Yagnesh Mehta said:
You told me that its depends on compiler but is there any common ANSWER?

The concept with TEXT, DATA, BSS is used by unix compilers, but are well-established terms.

But the terms only discuss type of information - not what physical storage media that will be used.

For a PC, everything will get into RAM.

For a microcontroller, TEXT would normally go to flash. But could just as well go to RAM. Bigger microcontrollers runs all code in RAM just for maximum speed. But not all microcontrollers can run code from RAM.

For a microcontroller DATA and BSS goes into RAM. But a microcontroller can have multiple RAM regions.
Sometimes using same addressing modes so the regions are just like multiple memories with different start address.
Sometimes using completely different addressing modes - so the regions can all start from address zero and the used processor instruction decides which of the regions that is addressed.

But DATA and BSS can end up in DATA, XDATA, ...

And const variables can be moved into CODE.

Next thing - CODE here doesn't mean flash. It just means that the 8051 needs to use the specific processor instructions that addresses the CODE memory space. The normal instruction fetching, jumps etc always uses this address space. But it is possible for some 8051 chips to map RAM into this address space. So CODE can contain both ROM and RAM.

So there are two completely different sets of class names that can be used. One based around the C standard view of a program. And one based around the processor view of the program.

List of 21 messages in thread
TopicAuthorDate
Memory Organization            01/01/70 00:00      
   Tried any good C book lately?            01/01/70 00:00      
      I am using Dennis Ritchie_ANCI C            01/01/70 00:00      
         Variables don't move just because you assign to them            01/01/70 00:00      
            can we start from ZERO........            01/01/70 00:00      
               Have you read my original post?            01/01/70 00:00      
               mixing stuff            01/01/70 00:00      
                  where it will be for MCU?            01/01/70 00:00      
                     is there any book for this fundamental things?            01/01/70 00:00      
                        and ....            01/01/70 00:00      
                     In this a general or Specific Question            01/01/70 00:00      
                        its General Que ????            01/01/70 00:00      
                           Separate "the C view of program" from "microcontroller view"            01/01/70 00:00      
                           NO!            01/01/70 00:00      
                              why not??            01/01/70 00:00      
                                 No - generic isn't meaningful            01/01/70 00:00      
                                 Interview questions can be asked out of limited knowledge            01/01/70 00:00      
                                    Seldom "one" answer other than to trivial questions            01/01/70 00:00      
   In Addition            01/01/70 00:00      
      Embedded?            01/01/70 00:00      
   sometimes, usually            01/01/70 00:00      

Back to Subject List