91
TR 0
MOV(21)
#0001
DM 02
0002
CLC(41)
ADD(30)
02
#6103
DM 01
MOV(21)
#0000
DM 02
1904
1904
Consecutive ADD(30)s can be used to perform eight-digit BCD addition. By
using two ADD(30)s and combining the augend and the addend words of one
ADD(30) with those of the other, two 8-digit values can be added. The result
may or may not be 9 digits depending on whether a carry is generated.
TR 0
MOV(21)
#0001
DM 06
1000
CLC(41)
ADD(30)
DM 00
DM 02
DM 04
MOV(21)
#0000
DM 06
1904
1904
0002
DIFU(13) 1000
ADD(30)
DM 01
DM 03
DM 05
In the above program the 8 digit augend consists of two words: DM 00 and
DM 01, with DM 01 being used for the 4 left digits and 00 for the 4 right dig-
its. Similarly the 8-digit addend consist of DM 02 and 03. Three words are
used to hold the results of the addition: DM 04, DM 05, and DM 06. In this
case DM 05 and DM 04 are used to represent the intermediate 4 digits and
the 4 right digits respectively. DM 06 represents the leftmost digit, the 9th dig-
it.
BCD Calculations Section 5–16