ABCD Instruction



Adds two bytes in BCD-form (Binary Coded Decimal). The destination operand is replaced with the sum of the source and the destination operand.

ADDRESS METHODS: Dn, -(An)

Only two methods are allowed:

1. Add data register to another data register (Dn to Dn)

2. Add memory to memory. This is used when you add BCD numbers stored in many bytes. You must start at the highest address (the least significant byte in the BCD number) and go upwards. The X flag is set if the addition results in a carry, which is added to the next byte.

DATA LENGTH: Byte

FLAGS: X - Set if carry from the most significant BCD digit.
N - undef
Z - Cleared if the result is NOT zero. Unaffected else.
C - Same as X
V - undef

 

SYNTAX: ABCD Dx,Dy
ABCD -(Ax),-(Ay)

EXAMPLE CODE:

   ABCD.B    D0,D1    Adds the 2 BCD numbers in D0 and D1 and stores the answer in D1