Specifying Offsets For Addresses; Overview - Omron CP1E CPU UNIT SOFTWARE User Manual

Cp1e cpu unit software
Table of Contents

Advertisement

4-5

Specifying Offsets for Addresses

4-5-1

Overview

When an address is specified for an instruction operand, it is possible to change the specified address
by specifying in brackets an offset for the specified address.
0.00[W0]
When the start address
is CIO 0.00 and W0 is
&2, 2 is added,
resulting in CIO 0.02.
10.00[4]
An offset of 4 is added
to the start address of
CIO 10.00, resulting in
CIO 10.04.
Bit Addresses
The bit address is offset by the amount specified by n (number of bits) from A (start bit address).
A [n]
Starting bit address
Bit
15 14 13 12 11 10 9
Word
Start Bit Address
It is possible to specify the start bit address with a bit address or with a symbol (except the NUMBER
data type cannot be used).
Offsetting is possible for all addresses except the DM Areas.
When specifying symbols, make the symbol table setting as the array variation. The number of
arrays will be the maximum number of offset + 1 bit at least.
The I/O comment for the start bit address is displayed.
Offset
The offset can be specified as a decimal constant, word address (but CIO Area addresses cannot
be specified), or a one-word symbol (i.e., symbols with the following data types: INT, UINT, WORD,
CHANNEL).
Words in the Auxiliary Area (A) can only be specified as a decimal constant.
If a word address is specified, the contents of the specified word is used as the offset.
If the offset exceeds bit 15 in the specified word, offsetting will continue from bit 00 in the next word.
If the offset is specified indirectly, make sure that the final bit address does not exceed the upper
limit of the memory area by using input comparison or other instruction.
CP1E CPU Unit Software User's Manual(W480)
Examples of
Specifying Bit
Address Offsets
Offset
Number of bits to offset: +n
8 7
6 5
4 Understanding Programming
MOV
When the start
address is D100 and
W1 is &3, 3 is added,
resulting in D103.
MOV
An offset of 12 is
added to the start
address of D100,
resulting in D112.
4 3
2 1
0
Starting bit address A
Examples of
Specifying Word
Address Offsets
4-19
4

Advertisement

Table of Contents
loading

Table of Contents