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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
Per Westermark
05/19/12 01:48
Read: 476 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
Memory Organization      Yagnesh Mehta      05/16/12 02:39      
   Tried any good C book lately?      Per Westermark      05/16/12 03:48      
      I am using Dennis Ritchie_ANCI C      Yagnesh Mehta      05/16/12 12:25      
         Variables don't move just because you assign to them      Per Westermark      05/18/12 02:33      
            can we start from ZERO........      Yagnesh Mehta      05/18/12 04:27      
               Have you read my original post?      Per Westermark      05/18/12 06:58      
               mixing stuff      Erik Malund      05/18/12 07:13      
                  where it will be for MCU?      Yagnesh Mehta      05/18/12 12:02      
                     is there any book for this fundamental things?      Andy Neil      05/18/12 14:59      
                        and ....      Erik Malund      05/18/12 16:33      
                     In this a general or Specific Question      Neil Kurzman      05/18/12 17:10      
                        its General Que ????      Yagnesh Mehta      05/18/12 23:50      
                           Separate "the C view of program" from "microcontroller view"        Per Westermark      05/19/12 01:48      
                           NO!      Erik Malund      05/19/12 15:53      
                              why not??      Yagnesh Mehta      05/20/12 21:56      
                                 No - generic isn't meaningful      Per Westermark      05/21/12 01:49      
                                 Interview questions can be asked out of limited knowledge      Kalpak Dabir      05/21/12 05:48      
                                    Seldom "one" answer other than to trivial questions      Per Westermark      05/21/12 06:41      
   In Addition      Michael Karas      05/16/12 10:24      
      Embedded?      Per Westermark      05/16/12 10:42      
   sometimes, usually      Erik Malund      05/16/12 13:17      

Back to Subject List