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).
Содержание SuperH SH-4A
Страница 2: ...Rev 1 50 10 04 page ii of xx ...
Страница 8: ...Rev 1 50 10 04 page viii of xx ...
Страница 116: ...Rev 1 50 10 04 page 96 of 448 ...
Страница 178: ...Rev 1 50 10 04 page 158 of 448 ...
Страница 206: ...Rev 1 50 10 04 page 186 of 448 ...
Страница 231: ...Rev 1 50 10 04 page 211 of 448 Possible Exceptions Slot illegal instruction exception ...
Страница 235: ...Rev 1 50 10 04 page 215 of 448 Possible Exceptions Slot illegal instruction exception ...
Страница 238: ...Rev 1 50 10 04 page 218 of 448 Possible Exceptions Slot illegal instruction exception ...
Страница 408: ...Rev 1 50 10 04 page 388 of 448 Possible Exceptions Inexact Not generated when FPSCR PR 1 ...
Страница 445: ...Rev 1 50 10 04 page 425 of 448 Possible Exceptions Invalid operation Overflow Underflow Inexact ...
Страница 446: ...Rev 1 50 10 04 page 426 of 448 ...
Страница 468: ...Rev 1 50 10 04 page 448 of 448 ...
Страница 471: ......
Страница 472: ...SH 4A Software Manual ...