Add - 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.1

ADD

Binary Addition
Format
ADD Rm,Rn
ADD #imm,Rn
Description
This instruction adds together the contents of general registers Rn and Rm and stores the result in
Rn.
8-bit immediate data can also be added to the contents of general register Rn.
8-bit immediate data is sign-extended to 32 bits, allowing use in decrement operations.
Operation
ADD(long m, long n) /* ADD Rm,Rn */
{
R[n]+=R[m];
PC+=2;
}
ADDI(long i, long n)
{
if ((i&0x80)==0)
R[n]+=(0x000000FF & (long)i);
else R[n]+=(0xFFFFFF00 | (long)i);
PC+=2;
}
Rev. 2.0, 03/99, page 200 of 396
ADD binary
Summary of Operation
Rn+Rm → Rn
Rn+imm → Rn
/* ADD #imm,Rn */
Arithmetic Instruction
Instruction Code
0011nnnnmmmm1100 1
0111nnnniiiiiiii 1
Execution
States
T Bit

Advertisement

Table of Contents
loading

Table of Contents