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

about the process of instruction fetch

Hi: I have read one of the app note that keil provided "in-system flash programming"
(http://www.keil.com/support/docs/2364.htm)
and became confused. In my opinion, the uC core can only fetch instruction from rom or flash. But as the app note said, the code can be execuated in ram(using srom class). The way of copy the code from flash to ram can be easily understand, but how can it execuate there. In my opinion, the process of how to fetch instruction is only decided by the core construction, but not the complier or linker tools. what is the real instruction fetch mechanism about 51MCU. Is there any document related ? I do not know search what key point for this question. Thaks for your help.

aaa1982

Parents
  • The way of copy the code from flash to ram can be easily understand, but how can it execuate there.

    If RAM is mapped into code space, code can be executed from there. There's no difference for the MCU.

    However, there needs to be a mechanism for copying the code to the RAM, since the 8051 does not have any instructions that write to code space. This can be accomplished, for example, by mapping the same RAM into the XRAM space, or by using SFRs to access this RAM.

Reply
  • The way of copy the code from flash to ram can be easily understand, but how can it execuate there.

    If RAM is mapped into code space, code can be executed from there. There's no difference for the MCU.

    However, there needs to be a mechanism for copying the code to the RAM, since the 8051 does not have any instructions that write to code space. This can be accomplished, for example, by mapping the same RAM into the XRAM space, or by using SFRs to access this RAM.

Children