beautypg.com

Function, Hint, Sample program – Omron SYSMAC CP CP1E-N@@D@-@ User Manual

Page 201: 2 instructions

background image

2-165

2 Instructions

CP1E CPU Unit Instructions Reference Manual(W483)

Sym

bol

Math I

n

stru

ctio

ns

2

+BC/+B

C

L

Function

+BC

+BC(406) adds BCD values in Au, Ad, and CY and outputs the result to R.

+BCL

+BCL(407) adds the BCD values in Au and Au+1, Ad and Ad+1, and CY and outputs the result to R,
R+1.

Hint

To clear the Carry Flay (CY), execute the Clear Carry (CLC(041)) instruction.

Sample program

+

CY

R

CY

(BCD)

(BCD)

(BCD)

Au

Ad

CY will turn ON
when there is a
carry.

+

R+1

CY

R

CY

(BCD)

(BCD)

(BCD)

Au+1

Ad+1

Au

Ad

CY will turn ON
when there is a
carry.

+BC

D100

D110

D120

0.00

+BCL

D100

D110

D120

0.00

When CIO 0.00 is ON in the following example, D100, D110,
and CY will be added as 4-digit BCD values, and the result will
be output to D120.

When CIO 0.00 is ON in the following example, D101, D100,
D111, D110, and CY will be added as 8-digit BCD values, and
the result will be output to D121 and D120.

This manual is related to the following products: