RTC
®
5 PC Interface Board
Rev. 1.9 e
6 Developing User Applications
79
innovators for industry
• Before executing the
command, be
sure the protected buffer area (“List 3”) is of suffi-
cient size after configuration of “List 1” and
“List 2” (
returns the number of stored
list commands). An indexed subroutine will
not
be stored by
memory
.
• Conversion of a subroutine by method 2 changes
the absolute memory address of the subroutine.
Deprotecting Subroutines
The protection of a subroutine stored in the
protected buffer area is removed if it is assigned via
to one of the list buffers (“List 1” or
“List 2”).
The subroutine can then still be called using the same
parameters (index or absolute memory address), but
no longer has protection against unintentional over-
writing.
Index Management and Defragmentation
Subroutines can be copied, renumbered or converted
via the
command, which creates an
additional reference (index) to an indexed subroutine
(that can also be called with this new index). The
command only alters the corresponding entry in the
internal management table and does not modify the
list buffer’s memory contents.
Unneeded references (unneeded entries in the
internal management table) can be deleted via the
command directly followed by a
command. Here, too, deletion occurs only
in the internal management table, while the list
commands of the previously referenced subroutine
continue to reside in the list buffer.
command can be used to query
whether a subroutine is referenced for a particular
index. If no subroutine is referenced, the return value
will be “–1” (i.e. 2
32
–1).
A real copy of an indexed subroutine in the protected
buffer area can be created (after the
command) with
with multiple references are thereby written several
times to the list memory. Keep this in mind in order
to prevent unintended buffer overflow of the
protected buffer area.
Memory for new indexed subroutines can sometimes
be blocked by no-longer-needed subroutines residing
at lower protected-buffer-area positions than those
of still-needed subroutines – this is because the
command always places a new indexed
subroutine after the referenced indexed subroutine
with the highest position in the memory. For this
reason, simply increasing the protected buffer area’s
size via
will fail to produce further usable
memory for storing additional indexed subroutines
(the protected buffer area can only be expanded
downward, not upward).
This situation can be resolved by defragmenting with
. All indexed subroutines and
non-indexed subroutines subsequently referenced via
will thereby be rewritten, starting
at the protected buffer area’s lowest memory
position and ordered by index. The now-available
upper memory can be used for storing additional
indexed subroutines.
Notes
• Before using
, be sure the protected
buffer area (“List 3”) is of sufficient size after
configuration of “List 1” and “List 2”. Indexed
subroutines without sufficient space there will
not
be stored by
. The
command returns the number of stored list
commands. No-longer-needed subroutines
should have been previously dereferenced via
directly followed by
.
• In some circumstances, index management or
defragmentation can alter the absolute memory
address of an indexed subroutine. It is therefore
not advisable to call an indexed subroutine via the
command.
•
stores subroutines starting from the
referenced address to the first-encountered
. Relative jumps are not evaluated. So
don’t use branches to several
commands. Instead, reclose eventual branches in
front of only one single
command.