move
Move data
Moves the value from the first operand to the second operand.
Used in
- Bytes, words and longsM68K assembly
- The M68K instruction setM68K assembly
- Addressing modesM68K assembly
- The condition code registerM68K assembly
- org, equ, dc and dsM68K assembly
- Memory regions and executable filesM68K assembly
- Compare and branchM68K assembly
- Loops and dbraM68K assembly
- Arithmetic, logic and bitsM68K assembly
- Arrays, strings and (a0)+M68K assembly
XNZVC –●●00
- ● set from the result
- 0 always 0
- – not changed
Forms
Privileged
A 68000 runs these only in supervisor mode; s68k runs every program in supervisor mode, as EASy68K does, so they run here too.
Operands
<ea>- An operand using one of the instruction’s supported addressing modes, such as
d0,(a0)+or4(a1). It may name a register, memory or an immediate value. More ccr- The condition-code register: the low byte of
sr, containing theX,N,Z,VandCflags. More sr- The 16-bit status register. Its upper byte contains system flags; its lower byte contains the condition codes. More
#imm- An immediate value written after
#: a number, character or label, such as#10,#$FFor#'a'. It must fit the operation’s size: byte-128to255, word-32768to65535, or long-2147483648to4294967295; signed and unsigned spellings are accepted. More
If the second operand is an address register, the MOVEA instruction is used instead.
* --- Different sizes ---
move.b #$FF, d0
move.w #$1234, d1
move.l #$AABBCCDD, d2
* --- Register to register ---
move.l d2, d3
* --- Immediate to memory ---
lea $2000, a0
move.l #$DEADBEEF, (a0)
move.w #$1234, 4(a0)
* --- Memory to register ---
move.l (a0), d4
move.w 4(a0), d5
* --- Post-increment and pre-decrement ---
lea $2000, a1
move.l (a1)+, d6
move.l #$11223344, -(a1)