Status Register (ST0)
2-24
6. 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.
7, 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 2
−
7. 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 0000
0000
16
to 7FFF
FFFF
16
Neg = Negative number from 8000
0000
16
to FFFF
FFFF
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.
Содержание 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...