Keil Logo

C51: Reserving Space in Code Memory

QUESTION

My target hardware has ROM from 0000h to 7FFFh and from C000h to FFFFh. I need to reserve the memory from 8000h to BFFFh. How do I tell the linker not to place any program code in that area?

ANSWER

The easiest way to do this is to declare a 16K character array in code space as shown below:

code char dummy_block [0x4000] _at_ 0x8000;

This will declare a 16K array at address 0x8000 in the code space. The linker won't place code there. You program code will "flow" around this dummy array.

MORE INFORMATION


Last Reviewed: Thursday, February 25, 2021


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.