EasyManuals Logo

Texas Instruments TMS320C28x User Manual

Texas Instruments TMS320C28x
695 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #548 background imageLoading...
Page #548 background image
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

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Texas Instruments TMS320C28x and is the answer not in the manual?

Texas Instruments TMS320C28x Specifications

General IconGeneral
BrandTexas Instruments
ModelTMS320C28x
CategoryProcessor
LanguageEnglish

Related product manuals