RTC
®
5 PC Interface Board
Rev. 1.9 e
6 Developing User Applications
78
innovators for industry
Subsequent Protection and Conversion of
Non-Indexed Subroutines
Non-indexed subroutines can be (directly) written
only to a list buffer area (“List 1” or “List 2”), but not
to the protected buffer area (“List 3”). There are
essentially two methods to subsequently assign
protection:
(1)
Change the configuration:
The region of the list buffer in which the non-
indexed subroutine was written (in case this
region lies in the upper range of the memory) is
assigned to the protected buffer area via the
command. Subroutines subsequently
protected in this manner remain non-indexed
(with unaltered memory addresses) and can, as
before, be called via the
command.
To enable non-indexed subroutines to be placed
in this manner in the uppermost range of the
memory, the corresponding memory area might
need to be temporarily assigned to the list buffer
via
prior to loading the non-indexed
subroutine.
(2)
Converting to indexed subroutines:
A non-indexed subroutine can be referenced via
the
subroutine is thereby assigned an index and is
included in the management of indexed subrou-
tines). It can subsequently be copied as an
indexed subroutine to the protected buffer area
(“List 3”) via
(
automatically stores all indexed subroutines and
non-indexed subroutines subsequently-refer-
enced via
onto on a PC storage
medium binarily, ordered by index
-
copies all those subroutines from there to the
protected buffer area). A subsequent call via
along with the index results in invoca-
tion of the copy residing in the protected buffer
area rather than the original.
If you want to subsequently protect a non-indexed
subroutine – either via method 1 or method 2 – then
be aware that absolute jumps within and out from
the protected buffer area are not allowed (see
Indexed subroutines subject to conversion
(method 2) must observe all programming rules
regarding indexed subroutines (see
Always try to use only one of the two methods in
order to avoid unintended data loss in the protected
buffer area via overwriting. If you begin working with
method 1 but later want to also use indexed subrou-
tines, then you should convert into indexed subrou-
tines all of the protected buffer area’s non-indexed
subroutines created with method 2 before you define
the first indexed subroutine via the
command.
When doing so, observe the following guidelines:
• If method 1 is used and you remove overwrite-
protection for a part of the protected buffer area,
then you risk overwriting indexed subroutines or
previously protected subroutines that might still
be needed.
• Non-indexed subroutines subsequently protected
with method 1 can under some circumstances be
unintentionally overwritten via a later
command.
command links the
supplied index with the supplied start address
even if an indexed subroutine had already been
previously defined for this index. The original
indexed subroutine with this index is then no
longer referenced and no longer callable via the
index.
• If using method 2, you should use it fully. If the
then the subroutine will already be callable via
and its index, but the subroutine
remains unprotected against overwriting.
Protection is obtained only after the subroutine is
subsequently copied as an indexed subroutine via
into the protected buffer
area. Likewise, the number of list commands in
the subroutine is included in the internal
management table only via
.
command ignores unreferenced
non-indexed subroutines, even those subse-
quently protected in the protected buffer area via
method 1. Be aware that they can be overwritten
in the protected buffer area via
/
cally replaces unallowed commands (e.g.
commands.
• Indexed subroutines repeatedly referenced with
will be duplicated in the list buffer
via a subsequent
/
. This could
lead to buffer overflow in the protected buffer
area.