![background image](http://html1.mh-extra.com/html/eaton/elc-pb/elc-pb_programming-manual_4017452268.webp)
3 . I n s t r u c t i o n S e t
M N050 03003E F or mo re infor ma tio n vi sit:
w w w. e a t o n . c o m
3-99
API Mnemonic
Operands
Function
43
D SUM P
S, D
Sum of ON bits
Bit Devices
Word devices
Program Steps
Type
OP
X Y M S K H KnX KnY KnM KnS T
C D E
F
S
* *
*
*
*
*
*
*
*
*
*
D
*
*
*
*
*
SUM, DSUMP: 5 steps
DSUM, DSUMP: 9 steps
ELC ELCB
ELCM
PB PC/PA/PH
PV
PB PH/PA
32 16
P
32 16
P
32 16
P 32 16 P 32 16
P
Operands:
S
: Source address
D
: Destination address stores number of ON bits
Description:
1.
If the contents of the16 bit source are all “0”, the “Zero” flag, M1020=ON.
2.
D
will occupy two registers when using as a 32-bit instruction.
3. If
operands
S
,
D
use index register F, it is only available as a 16-bit instruction.
4.
If no bits are ON then the zero flag, M1020 is set.
Program Example:
When X20 =ON, all the bits that = “1” in D0 will be counted and the number stored in D2.
X20
SUM
D0
D2
0
0
0
0
0
0
0
1
1
1
0
0
0
0
0
0
3
D2
D0
Содержание ELC-PB
Страница 1: ......
Страница 5: ...For more information visit www eaton com MN05003003E iv...
Страница 29: ...ELC Programming Manual For more information visit www eaton com MN05003003E 1 24 MEMO...
Страница 502: ...3 Instruction Set MN05003003E For more information visit www eaton com 3 333...
Страница 601: ...ELC Programming Manual For more information visit www eaton com MN05003003E 3 432...
Страница 625: ...ELC Programming Manual For more information visit www eaton com MN05003003E 3 456...