ARM Technical Support Knowledge Articles

LJMP & LCALL INSTEAD OF AJMP & ACALL

Applies to: C51 C Compiler

Answer

Information in this article applies to:


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

SEE ALSO

Article last edited on: 2005-09-22 11:35:19

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