C51: CREATE A PATCH VECTOR TABLE
Information in this article applies to:
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?
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.
Last Reviewed: Monday, July 18, 2005
of your data.