beautypg.com

4 instruction details, For / next – KEYENCE Visual KV Series User Manual

Page 152

background image

2.4 Instruction Details

3-128

2

Chapter 2 Instructions

Data memory block transfer

Comparison between a program with normal addressing and one with indirect
addressing.

Program with normal addressing

Program with indirect addressing

0000

1000

1000

1000

1000

DM0000

LDA

DM0100

STA

DM0001

LDA

DM0101

STA

DM0002

LDA

DM0102

STA

DM0003

LDA

DM0103

STA

1000

DM0098

LDA

DM0198

STA

1000

DM0099

LDA

DM0199

STA

1000

DIFU

END

ENDH

0000

1000

2002

#00000

LDA

TM02

STA

#00100

LDA

TM03

STA

2002

#TM02

LDA

#TM03

STA

TM02

INC

TM03

INC

SBN

0 0

FOR

#0100

NEXT

RET

ENDH

END

1000
DIFU

00

CALL

1)

2)

3)

4)

The contents of DM0000 are transferred
to DM0100.
The contents of DM0001 are transferred
to DM0101.
The contents of DM0002 are transferred
to DM0102.





The contents of DM0099 are transferred
to DM0199.

DM0000

DM0099

DM0100

DM0199

••••••

••••••

The block of 100 data is
transferred.

The contents of DM0000 are
transferred to DM0100.

The contents of DM0099 are
transferred to DM0199.

Transfer a
block of
data.

Program steps
are reduced by
one-eighth.

No. of data
memory to be
transferred.

The first No. of the source DM block is specified
(DM0000).
The first No. of the destination DM block is specified
(DM0100).
The contents of the DM indirectly addressed by
"#TM02" is transferred to the internal register.

The contents of the internal register are transferred
to the DM indirectly addressed by "#TM03".

Add "1" to both "TM02" and "TM03" to increment
the Nos. of the source and destination DMs by one.

➞➞

FOR / NEXT

KVNKA Chap 02_4bP.p65

08.3.11, 0:00 PM

128