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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
02/03/05 17:19
Read: times


 
#86487 - RAM, ROM, CODE, XDATA
Responding to: ???'s previous message
Neil Kurzman said:
The '51 expects CODE to be in CDATA and RAM to be XDATA.

The 8051 knows nothing about RAM or ROM - all it knows is CODE and XDATA.

It just knows that it will fetch instructions from CODE space, and can also read data from CODE space using the MOVC instruction.
There is no instruction to write to CODE space - so there is generally no point in putting writable memory (RAM) in CODE space.
Also, you generally want your code to be non-volatile - so you put it in ROM.
Thus ROM is usually fitted in CODE space, but "ROM" and "CODE space" are in no way synonymous.

On the other hand, the MOVX instruction can be used to read from XDATA space and write to XDATA space - so generally you will want writable memory (RAM) in XDATA space.
Of course, if you only ever read from XDATA (eg, you store only constants in XDATA) you could put a ROM in XDATA space.
Thus, again, although RAM is usually fitted in XDATA space, "RAM" and "XDATA space" are in no way synonymous.


List of 36 messages in thread
TopicAuthorDate
memory in keil-help            01/01/70 00:00      
   all the info, please            01/01/70 00:00      
   Back to Basics            01/01/70 00:00      
      is it in evaluation            01/01/70 00:00      
         what is a Keil memory window?            01/01/70 00:00      
         Is the right data in memory.            01/01/70 00:00      
            memory data is correct            01/01/70 00:00      
               please explain            01/01/70 00:00      
                  it's not linking            01/01/70 00:00      
   which is it            01/01/70 00:00      
      I got it - its in X-segment            01/01/70 00:00      
         Loading XDATA into Keil simulator            01/01/70 00:00      
         Read the Bible            01/01/70 00:00      
            Understanding Logic Correctly.            01/01/70 00:00      
               My post            01/01/70 00:00      
                  Wrong thing need to be corrected            01/01/70 00:00      
               or - and            01/01/70 00:00      
            i need help in keil            01/01/70 00:00      
               Are coding in C?            01/01/70 00:00      
                  To be precise...            01/01/70 00:00      
            CDATA LOADING-------NOT OFFENSE            01/01/70 00:00      
               Accessing the CODE area            01/01/70 00:00      
                  Your request is not clear            01/01/70 00:00      
                     Your request is not clear            01/01/70 00:00      
   explanation----problem            01/01/70 00:00      
      WHY            01/01/70 00:00      
         because more memory            01/01/70 00:00      
            still confoosing            01/01/70 00:00      
            Won't fit in CODE space?            01/01/70 00:00      
      OK            01/01/70 00:00      
         RAM, ROM, CODE, XDATA            01/01/70 00:00      
         XCONST - no need for separate Project            01/01/70 00:00      
            I learned Something New            01/01/70 00:00      
   constant delay-----problem            01/01/70 00:00      
      New Thread?            01/01/70 00:00      
      In the new thread            01/01/70 00:00      

Back to Subject List