Instruction Set Summary
3-10 MC68030 USER’S MANUAL MOTOROLA
3.2.7 Binary–coded Decimal Instructions
Five instructions support operations on binary-coded decimal (BCD) numbers. The
arithmetic operations on packed BCD numbers are add decimal with extend (ABCD),
subtract decimal with extend (SBCD), and negate decimal with extend (NBCD). PACK and
UNPACK instructions aid in the conversion of byte encoded numeric data, such as ASCII or
EBCDIC strings, to BCD data and vice versa. Table 3–7 is a summary of the BCD
operations.
Table 3-7. BCD Operations
Instruction Operand Syntax Operand Size Operation
ABCD Dn,Dn
–(An)
8
8
source
10
+ destination
10
+ X → destination
NBCD 〈ea〉 8 0 - destination
10
–X → destination
PACK –(An),–(An)
#〈data〉
Dn,Dn,# 〈data〉
16→8
16→8
unpackaged source + immediate data → packed
destination
SBCD Dn,Dn
–(An),–(An)
8
8
destination
10
- source
10
– X → destination
UNPK –(An)
#〈data〉
Dn,Dn,#〈data〉
8→16
8→16
packed source → unpacked source
unpacked source + immediate data →
unpacked destination