Keil Logo

C51: LJMP & LCALL INSTEAD OF AJMP & ACALL

Information in this article applies to:

  • C51 Version 5.50

SYMPTOMS

I'm using the C51 with the Atmel AT89S8252. I've got the following problems:

The AT89S8252 has 8K of Flash for the code and I could not find where to indicate to the C51 that the internal program memory is 8K instead of 2K.

Some of the functions are mapped by the linker in address locations higher than 7FFh and I don't know how to indicate that LCALL and LJMP should be used instead of ACALL and AJMP.

CAUSE

This is usually caused by setting the ROM model to ROM(SMALL) instead of ROM(LARGE) or ROM(COMPACT).

RESOLUTION

Check that you are using ROM(LARGE) and not ROM(SMALL).

ROM(SMALL) forces the total program size to 2K or less and forces the use of AJMP and ACALL instructions.

ROM(LARGE) lets the compiler use LJMP and LCALL instructions for all function calls. That lets you create programs up to 64K in size.

MORE INFORMATION

  • Refer to ROM in the Cx51 User's Guide.
  • Refer to ACALL in the 8051 Instruction Set Manual.
  • Refer to LCALL in the 8051 Instruction Set Manual.

SEE ALSO

Last Reviewed: Thursday, September 22, 2005


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.