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 #55 background imageLoading...
Page #55 background image
Status Register (ST0)
2-25Central Processing Unit
Z
Bit 4
Zero flag. Z is set if the result of certain operations is 0 or is cleared if the result is nonzero.
This applies to results that are loaded into ACC, AH, AL, another register, or a data-memory
location. At reset, Z is cleared.
The TEST ACC instruction sets Z if the value in ACC is 0. Otherwise, it clears Z.
Z can be summarized as follows:
0
The tested number is nonzero, or Z has been cleared.
1 The tested number is 0, or Z has been set.
C
Bit 3
Carry bit. This bit indicates when an addition or increment generates a carry or when a sub-
traction, compare, or decrement generates a borrow. It is also affected by rotate operations
on ACC and barrel shifts on ACC, AH, and AL.
During additions/increments, C is set if the addition generates a carry; otherwise C is
cleared. There is one exception: If you are using the ADD instruction with a shift of 16, the
ADD instruction can set C but cannot clear C.
During subtractions/decrements/compares, C is cleared if the subtraction generates a
carry; otherwise C is set. There is one exception: if you are using the SUB instruction with
a shift of 16, the SUB instruction can clear C but cannot set C.
This bit can be individually set and cleared by the SETC C instruction and CLRC C instruc-
tion, respectively. At reset, C is cleared.
C can be summarized as follows:
0
A subtraction generated a borrow, an addition did not generate a carry, or C has
been cleared. Exception: An ADD instruction with a shift of 16 cannot clear C.
1 An addition generated a carry, a subtraction did not generate a borrow, or C has
been set. Exception: A SUB instruction with a shift of 16 cannot set C.
Table 28 lists the bits that are affected by the C bit. For more information on
instructions, see Chapter 6.
Table 28. Bits Affected by the C Bit
Instruction Affect of or Affect on C
ABS ACC C = 0
ABSTC ACC C = 0
ADD ACC,#16bit << shift C = 1 on carry else C = 0
ADD ACC,loc16 << shift if(shift == 16)
C = 1 on carry
if(shift != 16)
C = 1 on carry else C = 0

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