![background image](http://html1.mh-extra.com/html/texas-instruments/tms320c28x/tms320c28x_reference-manual_1097071548.webp)
XRET
6-391
XRET
C2xLP Source-Compatible Return
SYNTAX OPTIONS
OPCODE
OBJMODE
RPT
CYC
XRET
0101 0110 1111 1111
1
−
7
Note:
XRET is an alias for RETC unconditional.
Operands
None
Description
Return conditionally. If the specified condition is true, a 16-bit value is
popped from the stack and stored into the low 16 bits of the PC while the
upper 6 bits of the PC are forced to 0x3F; Otherwise, execution continues
with the instruction following the XRETC operation:
if(COND = true)
SP = SP − 1;
PC = 0x3F:[SP];
Note:
This instruction can transfer program control only to a location located in the upper 64K
range of program space (0x3F0000 to 0x3FFFFF). To return from a call made by
XCALL, the XRET instruction must be used.
Flags and
Modes
V
If the V flag is tested by the condition, then V is cleared.
Repeat
This instruction is not repeatable. If this instruction follows the RPT
instruction, it resets the repeat counter (RPTC) and executes only once.
Example
; Return from FuncA if VarA does not equal zero, else set VarB
; to zero and return. This example only works for code located
; in upper 64K of program space:
XCALL FuncA
; Call FuncA
.
FuncA:
; Function A:
.
.
.
.
MOV AL,@VarA
; Load AL with contents of VarA
XRET NEQ
; Return if VarA does not equal 0
MOV @VarA,#0
; Store 0 into VarB
XRETC UNC
; Return unconditionally
Содержание TMS320C28x
Страница 30: ...1 12...
Страница 80: ...This page intentionally left blank 2 50 This page intentionally left blank...
Страница 269: ...IN loc16 PA 6 112 MOV AL 0 AL 0 UOUT IORegC AL IOspace IORegC AL 10...
Страница 308: ...MAXCUL P loc32 6 151 Saturate MOVL Var64 2 ACC Store result into Var64 MOVL Var64 P...
Страница 509: ...SUBL ACC P PM 6 352 SUBL ACC P PM ACC S B 11 M X 4 MOVH Y ACC 5 Store Q15 result into Y...
Страница 585: ...This page intentionally left blank 7 32 This page intentionally left blank...