36
The 68000's Instruction Set
D0. The decremented address register is updated to contain the
address of the last word stored.
If the effective address is in the post-increment mode (i.e.,
(An)+
), only a memory to register transfer is permitted. The
registers are loaded starting at the specified address and up
through higher addresses. The order of loading is the inverse of
that used by the pre-decrement mode and is D0 to D7 followed
by A0 to A7. The incremented address register is updated to
contain the address of the last word plus two (or four for longword
operands).
Note that the
MOVEM
instruction has a side effect. An extra
bus cycle occurs for memory operands, and an operand at one
address higher than the last register in the list is accessed. This
extra access is an overshoot and has no effect as far as the
programmer is concerned. However, it could cause a problem if
the overshoot extended beyond the bounds of physical memory.
Once again, remember that
MOVEM.W
sign-extends words when
they are moved to data registers.
Application:
This instruction is invariably used to save working registers on
entry to a subroutine and to restore them at the end of a
subroutine.
BSR Example
.
.
Example
MOVEM.L D0-D5/A0-A3,-(SP) Save registers
.
.
Body of subroutine
.
.
MOVEM.L (SP)+,D0-D5/A0-A3 Restore registers
RTS Return
Condition codes:
X N Z V C
- - - - -
Source operand addressing modes (memory to register)
Содержание 68000
Страница 1: ...Motorola 68000 s Instruction Set ...
Страница 2: ......