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 #306 background imageLoading...
Page #306 background image
MAX AX, loc16
6-149
MAX AX, loc16 Find the Maximum
SYNTAX OPTIONS OPCODE OBJMODE RPT CYC
MAX AX, loc16 0101 0110 0111 001A
0000 0000 LLLL LLLL
1 Y N+1
Operands AX Accumulator high (AH) or accumulator low (AL) register
loc16 Addressing modes (see Chapter 5)
Description Compare the signed contents of the specified AX register (AH or AL) with the
signed content of the location pointed to by the “loc16” addressing mode and
load the AX register with the larger of these two values:
if(AX < [loc16]), AX = [loc16];
if(AX >= [loc16]), AX = unchanged;
Flags and
Modes
N
If AX is less then the contents of the addressed location (AX < [loc16]) then
the negative flag bit will be set; otherwise, it will be cleared.
Z
If AX and the contents of the addressed location are equal (AX = [loc16]) then
the zero flag bit will be set; otherwise, it will be cleared.
V
If AX is less then the contents of the addressed location (AX < [loc16]) then
the overflow flag bit will be set. This instruction cannot clear the V flag.
Repeat If the operation is follows a RPT instruction, the instruction will be executed
N+1 times. The state of the N, Z, and V flags will reflect the final result.
Example
; Saturate VarA as follows:
; if(VarA > 2000) VarA = 2000;
; if(VarA < −2000) VarA = −2000;
MOV AL,@VarA ; Load AL with contents of VarA
MOV @AH,#2000 ; Load AH with the value 2000
MIN AL,@AH ; if(AL > AH) AL = AH
NEG AH ; AH = −2000
MAX AL,@AH ; if(AL < AH) AL = AH
MOV @VarA,AL ; Store result into VarA

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