MATLAB Link for Code Composer Studio Development Tools | ![]() ![]() |
Remove one or more registers from the list of saved registers stored in the property savedregs
of function objects
Syntax
Description
addregister(ff,regname)
removes register regname
from the list of registers that get preserved or reverted when a function is finished running. ff
indentifies the program function to which the register applies. You can delete any register you added from the saved registers list. You cannot delete registers that are on the default list of saved registers.
When you issue the createobj
call to create a handle to a function, the compiler creates the default list of saved registers. When you execute the function, the compiler saves the registers in the list, runs its process, and after completing its process, restores the saved registers to their initial state using the contents of the saved registers.
After a function generates a result, the execution process returns the saved registers to their initial states and values. When you delete a register you added to the saved registers list, the deleted register is not restored or saved with other registers in the list.
For each processor family, the default list of saved registers changes, as shown in these sections. The default lists include registers that the compiler saves and that MATLAB requires for MATLAB Link for Code Composer Studio to operate correctly.
AR1, AR6, AR7, and SP (required by MATLAB, not the compiler)
A0, A2, A6, A7, A8, A9. Also B0, B1, B2, B4, B5, B6, B7, B8, B9. To support MATLAB requirements, B15 (the stack pointer) gets saved as well.
Registers A3,A4, A5, and B3--your function must preserve these but they are not needed for reading function output.
A0, A2, A6, A7, A8, A9, A16, A17, A19, A19, A20, A21, A22, A23, A24, A25, A26, A27, A28, A29, A30, A31. Also B0, B1, B2, B4, B5, B6, B7, B8, B9, B16, B17, B18, B19, B20, B21, B22, B23, B24, B25, B26, B27, B28, B29, B30, B31. To support MATLAB requirements, B15 (the stack pointer) gets saved as well.
Register B15--not required by the compiler, but is required by MATLAB and is saved.
Registers A3, A4, and A5--function must preserve these but they're needed for reading function output
deleteregister(ff,reglist)
deletes the register names in reglist
from the list of registers that get preserved when a task is finished. ff
indentifies the function to which the register applies. reglist
is a cell array that contains the names of registers to remove from the saved registers collection.
See Also
![]() | delete | deref | ![]() |