MATLAB Link for Code Composer Studio Development Tools    
addregister

Append one or more registers to the list of saved registers stored in the property savedregs of function objects

Syntax

Description

addregister(ff,regname) adds register regname to 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 add any register to the saved registers list.

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 add a register to the saved registers list, the added register is restored and saved with the 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.

Default Saved Registers For C54x Processors

AR1, AR6, AR7, and SP (required by MATLAB, not the compiler)

Default Saved Registers For C62x and C67x Processors

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.

Default Saved Registers For C64x Processors

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.

addregister(ff,reglist) appends the register names in reglist to 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 on your processor that must be preserved during the changes that occur during operation.

See Also

deleteregister


  add address