2. Expanded Functions

2.4.1 Double-word multiplication and division (D∗//)

FUN 042

D/

Double-word multiplication and division

Expression

Input [ A+1A D/ B+1B C+1C ]Output

Function

When the input is ON, the data of A+1A is multiplied by the data of B+1B, and the product is divided by B+3B+2, then the quotient is stored in C+1C and the remainder in C+3C+2.

The data range is -2147483648 to 2147483647. If the result (quotient) is out of the data range, the following limit value is stored.

Positive overflow: quotient = 2147483647, remainder = 0

Negative overflow: quotient = -2147483647, remainder = 0

Execution condition

Input

 

Operation

Output

ERF

OFF

No execution

 

OFF

ON

B+3B+2

0, no overflow

Normal execution

ON

 

B+3B+2

0, overflow

Limit

ON

ON

 

B+3B+2 =

0

No execution

OFF

ON

Operand

 

Name

 

 

 

Device

 

 

 

 

 

 

 

Register

 

 

 

 

 

 

Con-

Index

 

 

X

Y

S

L

R

Z

T.

C.

I

O

X

Y

S

L

R

W

T

C

D

F

I

O

I

J

K

stant

 

 

 

 

 

 

 

 

 

 

 

 

 

W

W

W

W

W

 

 

 

 

 

W

W

 

 

 

 

 

A

Operation

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

data

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

B

Multiplier,

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

divisor

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

C

Result

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Example

When R0200 is ON, the double-word data of D0351D0350 is multiplied by the data of D0262D0261, and the product is divided by the data of D0264D0263, then the quotient is stored in D0401D0400 and the remainder in D0403D0402.

44 PROSEC T3H

Page 46
Image 46
Toshiba PROSEC T3H user manual Double-word multiplication and division D∗