ARM Technical Support Knowledge Articles

RESERVING SPACE IN CODE BANKS

Applies to: C51 C Compiler

Answer

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 uVision 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 uVision, 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

Article last edited on: 2004-06-07 13:10:30

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential