# move

## Purpose

Move the contents of one register-pair to another.

Note: It is legal to move from vN to either vN-1 or vN+1, so implementations must arrange for both halves of a register pair to be read before anything is written.

## Details

Op & Format | Mnemonic / Syntax | Arguments
--- | --- | ---
04 12x | move-wide vA, vB | `A:` destination register pair (4 bits) `B:` source register pair (4 bits)
05 22x | move-wide/from16 vAA, vBBBB | `A:` destination register pair (8 bits) `B:` source register pair (16 bits)
06 32x | move-wide/16 vAAAA, vBBBB | `A:` destination register pair (16 bits) `B:` source register pair (16 bits)

## Constraints

- Both A+1 and B+1 must be valid register indices in the current stackframe (which includes A and B being valid).
- Register vB must be the lower half of a register pair (which excludes the case of it containing a reference).
- Both register vB and v(B+1) must be defined.

## Behavior

- The value of register vB is moved to register vA, that is, vA' = vB.
- The value of register v(B+1) is moved to register v(A+1), that is, v(A+1)' = v(B+1).
- If register v(A-1) is the lower half of a register pair, then v(A-1)' becomes undefined.
- If register v(A+2) is the upper half of a register pair, then v(A+2)' becomes undefined.
- If A = B-1, then v(B+1)' becomes undefined.
- If A = B+1, then v(B)' becomes undefined.

## Exceptions

None.