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 #54 background imageLoading...
Page #54 background image
Status Register (ST0)
2-24
Table 26. Instructions Affected by V flag (Continued)
Instruction Description
XMACD P,loc16,*(pma)
V = 1 on signed overflow
XRETC COND V = 0 if tested
N
Bit 5
Negative flag. During certain operations, N is set if the result of the operation is a negative
number or cleared if the result is a positive number. At reset, N is cleared.
Results in ACC are tested for the negative condition. Bit 31 of ACC is the sign bit. If bit 31
is a 0, ACC is positive; if bit 31 is a 1, ACC is negative. N is set if a result in ACC is negative
or cleared if a result is positive.
Results in AH, AL, and other 16-bit registers or data-memory locations are also tested for
the negative condition. In these cases bit 15 of the value is the sign bit (1 indicates negative,
0 indicates positive). N is set if the value is negative or cleared if the value is positive.
The TEST ACC instruction sets N if the value in ACC is negative. Otherwise the instruction
clears N.
As shown in Table 27, under overflow conditions, the way the N flag is set for compare
operations is different from the way it is set for addition or subtraction operations. For addi-
tion or subtraction operations, the N flag is set to match the most significant bit of the trun-
cated result. For compare operations, the N flag assumes infinite precision. This applies
to operations whose result is loaded to ACC, AH, AL, another register, or a data-memory
location.
Table 27. Negative Flag Under Overflow Conditions
A
B
ÁÁÁÁÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁÁÁÁÁ
(A B)
Á
Á
ÁÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁÁ
Subtraction
ÁÁÁÁÁÁÁ
ÁÁÁÁÁÁÁ
Compare
Pos Neg
Neg
(due to overflow in positive direction)
N = 1 N = 0
Neg Pos
Pos
(due to overflow in negative direction)
N = 0 N = 1
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Á
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Á
Á
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Á
Á
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
Á
ÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁÁ
For 32-bit data: Pos = Positive number from 00000000
16
to 7FFFFFFF
16
Neg = Negative number from 80000000
16
to FFFFFFFF
16
For 16-bit data: Pos = Positive number from 0000
16
to 7FFF
16
Neg = Negative number from 8000
16
to FFFF
16
The compare instructions are CMP, CMPB, CMPL, MIN, MAX, MINL, and MAXL.
N can be summarized as follows:
0
The tested number is positive, or N has been cleared.
1 The tested number is negative, or N has been set.

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