Vault 7: Projects
This publication series is about specific projects related to the Vault 7 main publication.
© 2005-2011 Microchip Technology Inc. DS70157F-page 371
Section 5. Instruction Descriptions
Instruction
Descriptions
5
RETURN
Return
Implemented in: PIC24F PIC24H PIC24E dsPIC30F dsPIC33F dsPIC33E
X X X X
Syntax: {label:} RETURN
Operands: None
Operation: (W15) – 2 → W15
(TOS) → (PC<22:16>)
(W15) – 2 → W15
(TOS) → (PC<15:0>)
NOP → Instruction Register
Status Affected: None
Encoding: 0000 0110 0000 0000 0000 0000
Description: Return from subroutine. The software stack is POPped twice to restore
the PC. Since two POPs are made, the Stack Pointer (W15) is
decremented by 4.
Words: 1
Cycles: 3 (2 if exception pending)
Example 1:
001A06 RETURN ; Return from subroutine
Before
Instruction
After
Instruction
PC 00 1A06 PC 01 0004
W15 1248 W15 1244
Data 1244 0004 Data 1244 0004
Data 1246 0001 Data 1246 0001
SR 0000 SR 0000
Example 2:
005404 RETURN ; Return from subroutine
Before
Instruction
After
Instruction
PC 00 5404 PC 00 0966
W15 090A W15 0906
Data 0906 0966 Data 0906 0966
Data 0908 0000 Data 0908 0000
SR 0000 SR 0000
Protego_Release_01_05-Related-OEM-Documentation-PIC24FJ64GA004-Programmers_Reference_Manual.pdf