EasyManua.ls Logo

Motorola 68000 - Page 31

Motorola 68000
60 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
29
The 68000's Instruction Set
the base of the stack frame. The stack pointer itself has been
moved up by d bytes and is pointing at the top of the stack
frame. Address register An is called the frame pointer because it is
used to reference data on the stack frame. By convention,
programmers often use A6 as a frame pointer.
Application: The LINK and UNLK pair are used to create local workspace on the
top of a procedures stack. Consider the code:
Subrtn LINK A6,#-12 Create a 12-byte workspace
.
MOVE D3,(-8,A6) Access the stack frame via A6
.
.
UNLK A6 Collapse the workspace
RTS Return from subroutine
Condition codes: X N Z V C
- - - - -
The LINK instruction does not affect the CCR.
LSL, LSR Logical shift left/right
Operation: [destination] [destination] shifted by <count>
Syntax: LSL Dx,Dy
LSR Dx,Dy
LSL #<data>,Dy
LSR #<data>,Dy
LSL <ea>
LSR <ea>
Attributes: Size = byte, word, longword
Description: Logically shift the bits of the operand in the specified direction
(i.e., left or right). A zero is shifted into the input position and the
bit shifted out is copied into both the C- and the X-bit of the CCR.
The shift count may be specified in one of three ways. The count
may be a literal, the contents of a data register, or the value 1. An
immediate count permits a shift of 1 to 8 places. If the count is in
a register, the value is modulo 64  from 0 to 63. If no count is
specified, one shift is made (e.g., LSL <ea> shifts the word at the
effective address one position left).

Other manuals for Motorola 68000

Related product manuals