WMUL (BINARY)

WMUL, WMULP, DWMUL, DWMULP (Binary)

 

WMUL instruction multiplies S1 with S2 and save the result in Destination (assigned device address).

 

 

S1, S2

Source

D

Destination

 

Instruction

Device address

No. of Steps

Flag

M

X

Y

K

L

F

T

C

S

Z

D

@D

Int.

 

Error

Zero

Carry

WMUL(P)

DWMUL(P)

S1

o

o

o

o

o

o

o

o

-

o

o

o

o

4

o

-

-

S2

o

o

o

o

o

o

o

o

-

o

o

o

o

D

o

-

o

o

o

-

o

o

-

o

o

o

-

 

WMUL

Function

  • Multiply S1 with S2 and save the result as word type to D.

  • If the value is out of range -32,768 ~ 32,767, multiply instruction will not work and set error flag (F110).

 

Example)

If X00 is ON, multiply 26(D10) with 255(D20) and save 6630 to D40.

 

 

 

DWMUL

Function

  • Multiply S1(Double word) with S2(Double word) and save the result as double word type to D and D+1.

  • If the value is out of range -2,147,483,648 ~ 2,147,483,647, multiply instruction will not work and set error flag (F110).

 

Example)

If X01 is ON, multiply 67000(D0) with 312(D10) and then save HF840 to D20 and H013E to D21 in sequence.