Vault 7: Projects

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

16-bit MCU and DSC Programmer’s Reference Manual
DS70157F-page 178 © 2005-2011 Microchip Technology Inc.
Example 2:
072000 CALL _G66 ; call routine _G66
072004 MOV W0, W1
. ...
077A28 _G66: INC W6, [W7++] ; routine start
077A2A ...
077A2C
Before
Instruction
After
Instruction
PC 07 2000 PC 07 7A28
W15 9004 W15 9008
Data 9004 FFFF Data 9004 2004
Data 9006 FFFF Data 9006 0007
SR 0000 SR 0000
CALL
Call Subroutine
Implemented in: PIC24F PIC24H PIC24E dsPIC30F dsPIC33F dsPIC33E
X X
Syntax: {label:} CALL Expr
Operands:
Expr may be a label or expression (but not a literal).
Expr is resolved by the linker to a lit23, where lit23 [0 ... 8388606].
Operation:
(PC) + 4 PC
(PC<15:1>) TOS<15:1>, SFA bit TOS<0>
(W15) + 2 W15
(PC<23:16>) TOS
(W15) + 2 W15
0 SFA bit
lit23 PC
NOP Instruction Register
Status Affected:
SFA
Encoding:
1st word 0000 0010 nnnn nnnn nnnn nnn0
2nd word 0000 0000 0000 0000 0nnn nnnn
Description: Direct subroutine call over the entire 4-Mbyte instruction program
memory range. Before the CALL is made, the 24-bit return address
(PC + 4) is PUSHed onto the stack. After the return address is
stacked, the 23-bit value ‘lit23’ is loaded into the PC.
The ‘n’ bits form the target address.
Note: The linker will resolve the specified expression into the lit23 to
be used.
Words:
2
Cycles:
4

e-Highlighter

Click to send permalink to address bar, or right-click to copy permalink.

Un-highlight all Un-highlight selectionu Highlight selectionh