Keil Logo


Information in this article applies to:

  • C51 All Versions


I have discovered that if I change the order of OBJ files in the BL51 linker command line, I sometimes get the following error message:

Error L121: Improper Fixup

Is this a bug in the C51 package or is it an error in my code?


This error message may be caused under the circumstances described if the program was compiled in ROM(SMALL) or ROM(COMPACT). If the program subsequently outgrows the range of the AJMP and ACALL instructions used, the linker generates the FIXUP error.

When the linker cannot resolve the address of a branch instruction, it generates this error. The diagnostic reports the segment and the offset of the offending instruction. To figure out the location of the offending instruction, read the appropriate list file, find the reported function, and scan down the leftmost column for the offset within the segment. When you find the offset, that is the instruction that has the problem.

If it is an AJMP or ACALL, change the ROM model to ROM(LARGE) and re-compile your source files.

If you wrote some or all of your routines in assembly, the FIXUP error may be due to an AJMP or ACALL instruction whose target is out of range. Changing the AJMP/ACALL to LJMP/LCALL may solve the problem.



Last Reviewed: Tuesday, July 19, 2005

Did this article provide the answer you needed?
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.