Rev. 1.50, 10/04, page 240 of 448
10.1.21 EXTS (Extend as Signed): Arithmetic Instruction
Format
Operation
Instruction Code
Cycle
T Bit
EXTS.B Rm,Rn
Rm sign-extended from
byte
→
Rn
0110nnnnmmmm1110
1
—
EXTS.W Rm,Rn
Rm sign-extended from
word
→
Rn
0110nnnnmmmm1111
1
—
Description:
This instruction sign-extends the contents of general register Rm and stores the result in Rn.
For a byte specification, the value of Rm bit 7 is transferred to Rn bits 8 to 31. For a word
specification, the value of Rm bit 15 is transferred to Rn bits 16 to 31.
Notes:
None
Operation:
EXTSB(long m, long n)
/* EXTS.B Rm,Rn */
{
R[n] = R[m];
if ((R[m] & 0x00000080)==0) R[n] & =0x000000FF;
else R[n] |= 0xFFFFFF00;
PC += 2;
}
EXTSW(long m, long n)
/* EXTS.W Rm,Rn */
{
R[n] = R[m];
if ((R[m] & 0x00008000)==0) R[n] & =0x0000FFFF;
else R[n] |= 0xFFFF0000;
PC += 2;
}
Содержание 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 ...