RTC6 boards
Doc. Rev. 1.0.21 en-US
6 Developing RTC6-User Programs
116
Subsequent Protection and Conversion of
Non-Indexed Subroutines
Non-indexed subroutines can be (directly) written
only to a RTC6 List Memory area (“List 1” or “List 2”),
but not to the protected RTC6 List Memory area
“List 3”.
There are basically two methods to protect non-
indexed subroutines subsequently:
(1) Changing the configuration
The part of the RTC6 List Memory area in which
the non-indexed subroutine has been written is
assigned to the protected RTC6 List Memory area
“List 3” by config_list. The subroutine
subsequently protected in this manner remains
non-indexed (with unaltered memory address)
and can, as before, be called by list_call.
(2) Converting to indexed subroutines
set_sub_pointer is used to index a non-indexed
subroutine and thus include it in the memory
management of the indexed subroutines.
By save_disk/load_disk, it can subsequently be
copied as an indexed subroutine to the protected
RTC6 List Memory area “List 3”, see Section
”Defragmentation”, page 115.
With a subsequent call by sub_call via the index,
the subroutine in the protected RTC6 List Memory
area “List 3” is then started.
If you want to subsequently protect a non-indexed
subroutine – either by method 1 or method 2 – then
be aware that absolute jumps within and out from
the protected RTC6 List Memory area “List 3” are not
allowed, see Chapter 6.5.3 ”Jumps”, page 120.
With converting to indexed subroutines (method 2),
also all other programming rules for indexed
subroutines must be observed, see Section ”Rules for
Programming”, page 114.
Always try to use only one of the two methods. This
avoids unintended data loss in the protected
RTC6 List Memory area “List 3” by overwriting.
If you begin working with method 1 but later want to
also use indexed subroutines: then you should
convert all non-indexed subroutines residing in
the protected RTC6 List Memory area “List 3” to
indexed subroutines using method 2, before you
define the first indexed subroutine by load_sub.
When doing so, observe the following Notes.
Notes
• If method 1 is used and you remove overwrite-
protection for a part of the protected RTC6 List
Memory area “List 3”, then you risk overwriting
indexed subroutines or previously protected
subroutines.
• Non-indexed subroutines subsequently protected
with method 1 can under some circumstances be
overwritten by a later load_su
b or load_disk.
• set_sub_pointer links the supplied index with
the specified 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 indexed and no
longer callable by the index.