Exts - Hitachi SH7750 Programming Manual

High-performance risc engine superh (sh) 32-bit risc mcu/mpu series
Hide thumbs Also See for SH7750:
Table of Contents

Advertisement

10.23

EXTS

Sign Extension
Format
EXTS.B Rm,Rn
EXTS.W Rm,Rn
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.
Operation
EXTSB(long m, long n)
{
R[n]=R[m];
if ((R[m]&0x00000080)==0) R[n]&=0x000000FF;
else R[n]|=0xFFFFFF00;
PC+=2;
}
EXTSW(long m, long n)
{
R[n]=R[m];
if ((R[m]&0x00008000)==0) R[n]&=0x0000FFFF;
else R[n]|=0xFFFF0000;
PC+=2;
}
EXTend as Signed
Summary of Operation
Rm sign-extended from
byte → Rn
Rm sign-extended from
word → Rn
/* EXTS.B Rm,Rn */
/* EXTS.W Rm,Rn */
Arithmetic Instruction
Instruction Code
0110nnnnmmmm1110 1
0110nnnnmmmm1111 1
Rev. 2.0, 03/99, page 241 of 396
Execution
States
T Bit

Advertisement

Table of Contents
loading

Table of Contents