# MOVEM Instruction

The instruction MOVEM (MOVE Multiple) makes it possible to fast transfer a group of registers to or from memory. The operation only works with words and longwords. When you move words to registers, the words are sign extended so all 32 bits are affected. The instruction is most often used to push registers onto the stack, so you can temporarily use those register for other purposes, and later restore the original values. Very useful in the beginning and the end of subroutines that change a lot of registers.
ADDRESS METHODS: (An), -(An), x(An), x(An,xr.s), x.w, x.l
ADDRESS METHODS: (An), (An)+, x(An), x(An,xr.s), x.w, x.l, x(PC), x(PC,xr.s)
DATA LENGTH: Word, longword
FLAGS: Unaffected

SYNTAX: | MOVEM <register list>,<ea>
MOVEM <ea>,<register list>

The register list is a series of registers separated by a slash ("/"). You can also use one of many intervals (shown with a "-"). For example, D0-D5/A0-A2 means the registers D0, D1, D2, D3, D4, D5, A0, A1, A2.

EXAMPLE CODE:

MOVEM D0-D7/A1-A4,list moves all of the D resisters and 1 through 4 of the address resisters to memory