|
Hauptseite - Welches System? - Hardware - Software - Emulatoren - |
Internet MausNet Programmieren Verweise Über |
NAME | LINK -- Create local stack frame | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
SYNOPSIS |
Size = (Word, Long) (68020+) |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
FUNCTION |
This instruction saves the specified address register onto
the stack, then places the new stack pointer in that register. It
then adds the specificed immediate data to the stack pointer. To
allocate space on the stack for a local data area, a negative value
should be used for the second operand. The use of a local stack frame is critically important to the programmer who wishes to write re-entrant or recursive functions. The creation of a local stack frame on the MC680x0 family is done through the use of the LINK and UNLK instructions. The LINK instruction saves the frame pointer onto the stack, and places a pointer to the new stack frame in it. The UNLK instruction restores the old stack frame. For example: link a5,#-8 ; a5 is chosen to be the frame ; pointer. 8 bytes of local stack ; frame are allocated. ... unlk a5 ; a5, the old frame pointer, and the ; old SP are restored.Since the LINK and UNLK instructions maintain both the frame pointer and the stack pointer, the following code segment is perfectly legal: link a5,#-4 movem.l d0-a4,-(sp) pea (500).w move.l d2,-(sp) bsr.b Routine unlk a5 rts |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
FORMAT |
For Word size:
OFFSET is a signed value, generally negative, which enables to move the stack pointer. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
RESULT | None. |
![]() |
English version not yet available. |