Muls.w - 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.64

MULS.W

Signed
Multiplication
Format
MULS.W Rm,Rn
MULS
Rm,Rn
Description
This instruction performs 16-bit multiplication of the contents of general registers Rn and Rm, and
stores the 32-bit result in the MACL register. The multiplication is performed as a signed
arithmetic operation. The contents of MACH are not changed.
Operation
MULS(long m, long n) /* MULS Rm,Rn */
{
MACL=((long)(short)R[n]*(long)(short)R[m]);
PC+=2;
}
Example
MULS.W
R0,R 1
STS
MACL,R0
MULtiply as Signed Word
Summary of Operation
Signed, Rn × Rm → MACL
;Before execution R0 = H'FFFFFFFE, R1 = H'00005555
;After execution
;Get operation result
Arithmetic Instruction
Instruction Code
0010nnnnmmmm1111 2–5
MACL = H'FFFF5556
Rev. 2.0, 03/99, page 333 of 396
Execution
States
T Bit

Advertisement

Table of Contents
loading

Table of Contents