Keil Logo

C51: RESERVING SPACE IN CODE BANKS

QUESTION

How can I reserve space in a couple of the banks in a code banking program?

ANSWER

Reserving code space in code banking applications requires that you use an assembler source module. For example:

RESERVE_BANK0 SEGMENT CODE
RSEG RESERVE_BANK0
DS      2000H           ; reserve 2000H bytes

RESERVE_BANK1 SEGMENT CODE
RSEG RESERVE_BANK1
DS      1000H           ; reserve 1000H bytes

END

Put the above code into an A51 source file (reserves.a51) and include it in your µVision project. Under the Linker options Additional tab, enter the following:

BANK0 (RESERVE_BANK0 (4000H))  /* set start address to 4000H */
BANK1 (RESERVE_BANK1 (5000H))  /* set start address to 5000H */

This reserves the memory regions 4000H-5FFFH in BANK0 and 5000H-5FFFH in BANK1.

If you are not using µVision, change your linker command line as follows:

BL51  <your current file list>, COMMON {RESERVES.OBJ} TO YOURPROG
     BANK0 (RESERVE_BANK0 (4000H))
     BANK1 (RESERVE_BANK1 (5000H))

MORE INFORMATION

Last Reviewed: Monday, June 7, 2004


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.