Indirect addressing – KEYENCE Visual KV Series User Manual

Page 151

Advertising
background image

2.4 Instruction Details

1

2

3-127

Chapter 2 Instructions

Indirect addressing

Indirect addressing
Indirect addressing is used to so you don't have to use fixed data memories or relay
Nos. when the contents of data memory or a relay is stored in internal registers, or
when the contents of the internal memory is stored in data memory or a relay.

Method for indirect addressing

Specify the operand for instructions as "#TMxx". The contents of "TMxx" is
considered to be the specification No. (indirect addressing).

Example

When TM02 value is "0000", "#TM02" represents DM0000.
When TM02 value is "10000", "#TM02" represents 0000 (relay).

Any of "02" through "29" can be specified for "xx".

Specify the desired decimal number for "xx".

Numbers "0000" through "1999" specify DM0000 through DM1999 (data
memory).
Numbers "10000" through "27915" specify 0000 through 17915 (relay).

Example: LDA #TM15

This is the same operation whether "LDA DM0020" or "LDA 1000" is specified. The
specified data memory or relay can be changed as desired by changing the value of
TM15.

Example: STA #TM02

This is the same operation whether "STA DM0000" or "STA 3000" is specified. The
specified data memory or relay can be changed as desired by changing the value of
TM02.

Range of DM and relay Nos. that can be specified by "TMxx"

Instructions which can use indirect addressing:
Specify "#TMxx" as an operand relay.
LDA, @LDA, STA, @STA, CMP, @CMP, ADD, @ADD, SUB, @SUB, MUL, @MUL,
DIV, @DIV, ANDA, @ANDA, ORA, @ORA, EORA, @EORA

Note 1: "2000" to "9999" cannot be used as a TMxx value.

Note 2: If there is no data memory or relay corresponding to the number specified
with "#TMxx", special utility relay 2012 turns ON.

TM15 value

Data entered into internal register

20

DM0020

11000

1000 to 1015

TM02 value

Specified destination

00

DM0000

13000

3000 to 3015

TMxx value

DM/relay

0000 to 1999

DM0000 to DM1999

2000 to 9999

Cannot be used.

10000 to 27915

0000 to 17915

FOR / NEXT

KVNKA Chap 02_4bP.p65

08.3.11, 0:00 PM

127

Advertising