beautypg.com

Application of mul instruction, Div (division) – KEYENCE Visual KV Series User Manual

Page 180

background image

2.4 Instruction Details

3-156

2

Chapter 2 Instructions

2002

DM0001

LDA

TM00

STA

DM0000

LDA

#00100

DIV

DM0002

STA

TM00

LDA

DM0003

STA

TM01

LDA

DM0004

STA

Line No.

Instruction

Operand

0000

LD

2002

0001

LDA

DM0001

0002

CON

0003

STA

TM00

0004

CON

0005

LDA

DM0000

0006

CON

0007

DIV

#00100

0008

CON

0009

STA

DM0002

0010

CON

0011

LDA

TM00

0012

CON

0013

STA

DM0003

0014

CON

0015

LDA

TM01

0016

CON

0017

STA

DM0004

Application of MUL instruction

Multiplying the counter current value by the DM value
Multiplies the counter current value by the DM0000 value and writes the high-order
16 bits of the product into DM0101 and low-order 16 bits of the product into
DM0100.

Coding

DIV (Division)

Coding

0001

C001

LDA

DM0000

MUL

DM0100

STA

TM00

LDA

DM0101

STA

2002

#09999

0000

C001

Line No.

Instruction

Operand

0000

LDB

0001

0001

C

001 #099999 0000

0002

LD

2002

0003

LDA

C001

0004

CON

0005

MUL

DM0000

0006

CON

0007

STA

DM0100

0008

CON

0009

LDA

TM00

0010

CON

0011

STA

DM0101

High-order

Low-order

Low-order

High-order

Remainder

MUL / @MUL / DIV / @DIV

KVNKA Chap 02_4cP.p65

08.3.11, 0:02 PM

156