# `movea`

[M68K Documentation](https://asm-editor.specy.app/documentation/m68k.md) › [Instructions](https://asm-editor.specy.app/documentation/m68k/instruction.md)

Web page: https://asm-editor.specy.app/documentation/m68k/instruction/movea

**Move address**

Category: Data movement

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

Sizes .w .l, .w by default

Used in: [Flappy ASM](https://asm-editor.specy.app/learn/courses/m68k/examples/flappy-asm.md) (M68K assembly)

## Flags

| Flag | Effect |
| --- | --- |
| X | not changed |
| N | not changed |
| Z | not changed |
| V | not changed |
| C | not changed |

## Forms

- `movea <ea>, An`
  - Source: Dn, An, (An), (An)+, -(An), d(An), d(An,Xn), abs, d(PC), d(PC,Xn), #imm (all modes)

## Operands

- [`<ea>`](https://asm-editor.specy.app/documentation/m68k/addressing-mode.md): 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](https://asm-editor.specy.app/documentation/m68k/addressing-mode/68020.md).
- [`An`](https://asm-editor.specy.app/documentation/m68k/addressing-mode/direct.md): An address register, `a0` to `a7`; `sp` is another name for `a7`.
- [`#imm`](https://asm-editor.specy.app/documentation/m68k/addressing-mode/immediate.md): 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.

## Description

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

## Example

```m68k
* --- Word is sign-extended to long ---
move.l #$0008, d0
movea.w d0, a0

* --- Negative word sign-extends with 1s ---
move.l #$FFF0, d1
movea.w d1, a1 ; a1 = $FFFFFFF0

* --- Long is copied as-is ---
move.l #$12345678, d2
movea.l d2, a2

* --- Does not affect flags ---
move.l #0, d3
tst d3
movea.l #$FFFFFFFF, a3 ; flags unchanged
```
