Omron C200HX Computer Hardware User Manual


 
230
Example If 00002 is ON, the program represented by the following diagram clears CY with
CLC(41), adds the content of LR 25 to a constant (6103), places the result in DM
0100, and then moves either all zeros or 0001 into DM 0101 depending on the
status of CY (25504). This ensures that any carry from the last digit is preserved
in R+1 so that the entire result can be later handled as eight-digit data.
TR 0
MOV(21)
#0001
DM 0101
00002
CLC(41)
ADD(30)
LR 25
#6103
DM 0100
MOV(21)
#0000
DM 0101
25504
25504
Address Instruction Operands
00000 LR 00002
00001 OUT TR 0
00002 CLC(41)
00003 ADD(30)
LR 25
# 6103
DM 0100
00004 AND 25504
00005 MOV(21)
# 0001
DM 0101
00006 LD TR 0
00007 AND NOT 25504
00008 MOV(21)
# 0000
DM 0101
Although two ADD(30) can be used together to perform eight-digit BCD addition,
ADDL(54) is designed specifically for this purpose.
5-19-6 DOUBLE BCD ADD ADDL(54)
Au: First augend word (BCD)
IR, SR, AR, DM, HR, TC, LR
Ad: First addend word (BCD)
IR, SR, AR, DM, HR, TC, LR
Ladder Symbols
Operand Data Areas
R: First result word
IR, SR, AR, DM, HR, LR
ADDL(54)
Au
Ad
R
@ADDL(54)
Au
Ad
R
Limitations Each of the following pairs must be in the same data area: Au and Au+1, Ad and
Ad+1, and R and R+1.
Description When the execution condition is OFF, ADDL(54) is not executed. When the
execution condition is ON, ADDL(54) adds the contents of CY to the 8-digit val-
ue in Au and Au+1 to the 8-digit value in Ad and Ad+1, and places the result in R
and R+1. CY will be set if the result is greater than 99999999.
Au + 1 Au
Ad + 1 Ad
R + 1 R
+
CY
CY
BCD Calculations Section 5-19