EasyManuals Logo

Renesas SuperH SH-4A User Manual

Renesas SuperH SH-4A
472 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 #259 background imageLoading...
Page #259 background image
Rev. 1.50, 10/04, page 239 of 448
10.1.20 DT (Decrement and Test): Arithmetic Instruction
Format Operation Instruction Code Cycle T Bit
DT Rn Rn – 1 → Rn;
if Rn = 0, 1 → T
if Rn ≠ 0, 0 → T
0100nnnn00010000 1 Result of
comparison
Description: This instruction decrements the contents of general register Rn by 1 and compares
the result with zero. If the result is zero, the T bit is set to 1. If the result is nonzero, the T bit is
cleared to 0.
Notes: None
Operation:
DT(long n)/* DT Rn */
{
R[n]--;
if (R[n]==0) T = 1;
else T = 0;
PC += 2;
}
Example:
MOV #4,R5 ;Set loop count
LOOP:
ADD R0,R1 ;
DT R5 ;Decrement R5 value and check for 0.
BF LOOP ;If T = 0, branch to LOOP (in this example, 4 loops are executed).

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Renesas SuperH SH-4A and is the answer not in the manual?

Renesas SuperH SH-4A Specifications

General IconGeneral
BrandRenesas
ModelSuperH SH-4A
CategoryComputer Hardware
LanguageEnglish

Related product manuals