adda

Add address

Adds the first operand to an address register, sign extending a word to long and leaving sr unchanged.

Sizes .w .l, .w by default

XNZVC –––––
  • Changes no flag

Forms

Operands

<ea>
An operand using one of the addressing modes listed for this form. The list determines whether it can be a register, memory or an immediate value. With opt p=68020, an allowed d(An,Xn) or d(PC,Xn) mode also permits the corresponding 68020 indexed and memory indirect forms. See 68020 addressing. More
An
An address register, a0 to a7; sp is another name for a7. More
#imm
An immediate value written after #: a number, character or label, such as #10, #$FF or #'a'. It must fit the operation’s size: byte -128 to 255, word -32768 to 65535, or long -2147483648 to 4294967295; signed and unsigned spellings are accepted. More

It does not change the SR. When using word size, the first operand is sign extended to long and the second is read and written as a long.

* --- Word is sign-extended before adding ---
move.l #$10000, a0
adda.w #$FFFE, a0 ; $FFFE sign-extends to $FFFFFFFE (-2)

* --- Long adds as-is ---
move.l #$10000, a1
adda.l #$10000, a1

* --- Does NOT affect flags (compare with add) ---
move.l #$10000000, d0
move.l #$10000000, a2
add.l #$F0000000, d0 ; wraps to zero and sets carry
adda.l #$F0000000, a2 ; flags unchanged