Neg - 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.66

NEG

Sign Inversion
Format
NEG Rm,Rn
Description
This instruction finds the two's complement of the contents of general register Rm and stores the
result in Rn. That is, it subtracts Rm from 0 and stores the result in Rn.
Operation
NEG(long m, long n) /* NEG Rm,Rn */
{
R[n]=0-R[m];
PC+=2;
}
Example
NEG
R0,R1
NEGate
Summary of Operation
0-Rm → Rn
;Before execution R0 = H'00000001
;After execution
Arithmetic Instruction
Instruction Code
0110nnnnmmmm1011 1
R1 = H'FFFFFFFF
Rev. 2.0, 03/99, page 335 of 396
Execution
States
T Bit

Advertisement

Table of Contents
loading

Table of Contents