# Vault 7: Projects

This publication series is about specific projects related to the Vault 7 main publication.

### Protego

# PIC24FJ64GA004 - Programmers Reference Manual

- 1
- 2
…
- 265
- 266
- 267
- 268
- 269
…
- 501
- 502

© 2005-2011 Microchip Technology Inc. DS70157F-page 267
Section 5. Instruction Descriptions
Instruction
Descriptions
5
LNK
Allocate Stack Frame
Implemented in: PIC24F PIC24H PIC24E dsPIC30F dsPIC33F dsPIC33E
X X X X
Syntax: {label:} LNK #lit14
Operands: lit14 ∈ [0 ... 16382]
Operation: (W14) → (TOS)
(W15) + 2 → W15
(W15) → W14
(W15) + lit14 → W15
Status Affected: None
Encoding:
1111 1010 00kk kkkk kkkk kkk0
Description: This instruction allocates a Stack Frame of size lit14 bytes for a
subroutine calling sequence. The Stack Frame is allocated by PUSHing
the contents of the Frame Pointer (W14) onto the stack, storing the
updated Stack Pointer (W15) to the Frame Pointer and then incrementing
the Stack Pointer by the unsigned 14-bit literal operand. This instruction
supports a maximum Stack Frame of 16382 bytes.
The ‘k’ bits specify the size of the Stack Frame.
Note: Since the Stack Pointer can only reside on a word boundary,
lit14 must be even.
Words: 1
Cycles: 1
Example 1:
LNK #0xA0 ; Allocate a stack frame of 160 bytes
Before
Instruction
After
Instruction
W14 2000 W14 2002
W15 2000 W15 20A2
Data 2000 0000 Data 2000 2000
SR 0000 SR 0000

- 1
- 2
…
- 265
- 266
- 267
- 268
- 269
…
- 501
- 502