ADDX Instruction



The instruction ADDX (ADD eXtended) works as ADD but the X flag is also added. This makes it possible to add big numbers stored in many bytes.

The instruction has two methods:

1. Add a data register to a data register.
2. Add a memory location to another memory location. You must use -(An) on
both operands then.

ADDRESS METHODS: Dn, -(An)

DATA LENGTH: Byte, word, longword

FLAGS: X - Set if carry from the most significant bit, otherwise it is cleared.
N - S
Z - S
C - Same as X
V - S

The Z flag works in another way now, making it possible to check if a big number (much bigger than 32 bits) is zero. You must set the zero flag before making the addition though, shorter than comparing a register with itself.

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

EXAMPLE CODE:   

   ADDX    D0,D1    Adds D0 and D1 + X bit.  then clears the X bit