Keil Logo

BL51: Linking Programs Larger Than 64K


Information in this article applies to:

  • C51 All Versions

QUESTION

I want to build a project using the 8051. I converted my code from BorlandC to Keil and it compiled OK. However, it didn't link because the total code size came out to about 90K.

I started searching for ways to have a 90K program, however, I can't figure out how to do this. Is there a way to have a 90K program run on the 8051?

ANSWER

Yes. However, you must have bank-switching hardware and you must use the bank switching features of the BL51 code-banking linker.

By default, the 8051 only supports 64K of total code memory. This is due to the 8051's addressing method, which is based on a 16-bit address. Additionally, the 8051 only has 16 address lines (2^16 = 64K).

With bank switching, you can have up to 32 banks of 64K for a total of 2 megabytes of code space. Refer to C51: Creating Code Banking Programs for more details on how to setup the linker for code banking. You may also refer to the code banking examples in the \C51\EXAMPLES directory of your installation.


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.