addregister - Append registers to list of saved registers in property savedregs of function objects

Syntax

addregister(ff,regname)
addregister(ff,regnamelist)

Description

addregister(ff,regname) adds register regname to the list of registers to preserve or restore after a function is finished running. ff identifies the program function to which the register applies. You can add any register to the saved registers list.

When you issue the createobj command 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, uses the contents of the saved registers to restore the saved registers to their initial state .

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 software requires for Embedded IDE Link CC to operate correctly.

Default Saved Registers for C28x Processors

AL, AH, AR0, AR1, AR2, AR3, AR4, AR5, AR6, AR7, XAR0, XAR1, XAR2, XAR3, XAR4,XAR5, XAR6, XAR7, SP, T, TL, PL, PH, DP

Default Saved Registers for C54x Processors

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

Default Saved Registers for C55x Processors

T0, T1, T2, T3, TRN0, TRN1, AR0, AR1, AR2, AR3, AR4, AR5, AR6, AR7, XAR0, XAR1, XAR2, XAR3, XAR4, XAR5, XAR6, XAR7, AC0, AC1, AC2, AC3

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 software 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 software requirements, B15 (the stack pointer) gets saved as well.

Register B15 — not required by the compiler, but is required by MATLAB software and is saved.

Registers A3, A4, and A5 — function must preserve these but they are needed for reading function output.

Default Saved Registers for R1x and R2x Processors

R0, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12, R13, R14,R15

addregister(ff,reglist) appends the register names in reglist to the list of save-on-call (SOC) registers ff.savedregs that get preserved when a task is finished. ff identifies 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. You can also enter one register name in reglist as a string.

When you add entries to the existing SOC list, follow these recommendations:

These considerations ensure that the register values saved are the original register values.

See Also

deleteregister

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS
 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS