Keil Logo

C51: CREATE A PATCH VECTOR TABLE


Information in this article applies to:

  • C51 Version 7
  • AX51 Version 2

QUESTION

I need to create a ROM mask that provides some functions. However, it should be possible to overwrite the functions for providing software patches. Therefore, a patch table is located in a Flash ROM that may be overwritten by later software downloads, whereas the main part of the software is located in mask ROM and cannot be modified later.

Currently I have defined this patch table as shown below:

EXTRN  CODE (Func0, Func1)
PUBLIC vFunc0, vFunc1

?PR?PPATCHTABLE SEGMENT CODE
RSEG ?PR?PPATCHTABLE
vFunc0:  LJMP vFunc0
vFunc1:  LJMP vFunc1

However, during linkage I get a problem with the data overlaying that is implemented in the 8051 linker. It reports *** WARNING L13: RECURSIVE CALL TO FUNCTION, even when there are no program recursions. How can I prevent the linker from reporting such warnings?

ANSWER

The overlay analysis of the linker is based on segment names. However, the Extended AX51 Macro Assembler (which is part of the PK51 Professional Developer's Kit) also supports a procedure concept. First, select the Extended AX51 Macro Assembler under Options for Target - Device.

Then modify your patch table as shown below:

?PR?PPATCHTABLE SEGMENT CODE
RSEG ?PR?PPATCHTABLE
vFunc0   PROC
         LJMP vFunc0
         ENDP

vFunc1   PROC
         LJMP vFunc1
         ENDP

Due to the PROC / ENDP statements, the linker can isolate the individual functions and generate a proper call tree during overlay analysis.

MORE INFORMATION

  • Refer to RSEG in the Ax51 User's Guide.

SEE ALSO

Last Reviewed: Monday, July 18, 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.