This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

memory models

what is the concept of memory models with regard to embedded C?
i read the section in keil online manual,is there a bit more digestable explanation about it?

  • what is the concept of memory models with regard to embedded C?

    Well, the memory models save you from having to specify a memory area for each and every variable you define.

    Depending on the memory model, variables without a memory area specifier will go in the "default" area (data, pdata or xdata).

    Of course, it may be tempting to use the large memory model and not worry about the memory areas at all - however, the '51 architecture has very significant differences in CPU time necessary to access the various memory areas, and the large memory model will put all variables in xdata, where access is slowest.

  • "what is the concept of memory models with regard to embedded C?"

    There is no general tern "memory model" that is universally applicable to embedded 'C'.

    Keil use the term with the specific meaning defined in their Documentation:
    http://www.keil.com/support/man/docs/c51/c51_le_memmodels.htm

    Other contexts may use the term with an entirely different meaning!