LCR *XARn
LCR *XARn
SYNTAX OPTIONS
LCR *XARn
Operands
*XARn
Description
Flags and
Modes
Repeat
Example
; Call to subroutines in SwitchTable selected by Switch value:
SwitchTable:
.long Switch0
.long Switch1
.
MOVL
MOVZ
MOVL
LCR
.
Switch0:
.
.
LRETR
Switch1:
.
LRETR
6-124
0011 1110 0110 0RRR
indirect program-memory addressing using auxiliary register XAR0 to
XAR7, can access full 4Mx16 program space range (0x000000 to
0x3FFFFF)
Long indirect call using return PC pointer (RPC). The current RPC value is
pushed onto the software stack, pointed to by SP register, in two 16-bit
operations. Next, the RPC register is loaded with the return address. Next,
the destination address stored in the XARn register is loaded into the PC:
[SP] = RPC(15:0);
SP = SP + 1;
[SP] = RPC(21:16);
SP = SP + 1;
RPC
= PC + 1;
PC
= XARn(21:0);
Note:
The LCR and LRETR operations, enable 4 cycle call and 4 cycle return. The standard
LC and LRET operations only enable a 4 cycle call and 8 cycle return. The LCR and
LRETR operations can be nested and can freely replace the LC and LRET operations.
This is the case on interrupts also. Only on a task switch operation, does the RPC need
to be manually saved and restored.
None
This instruction is not repeatable. If this instruction follows the RPT
instruction, it resets the repeat counter (RPTC) and executes only once.
XAR2,#SwitchTable
AR0,@Switch
XAR6,*+XAR2[AR0]
*XAR6
Long Indirect Call Using RPC
OPCODE
OBJMODE
; Switch address table:
; Switch0 address
; Switch1 address
; XAR2 = pointer to SwitchTable
; AR0
= Switch index
; XAR6 = SwitchTable[Switch]
; Indirect RPC call using XAR6
; Subroutine 0:
; RPC Return
; Subroutine 1:
; RPC Return
RPT
CYC
1
−
4
Need help?
Do you have a question about the TMS320C28x and is the answer not in the manual?