Vault 7: Projects
This publication series is about specific projects related to the Vault 7 main publication.
© 2005-2011 Microchip Technology Inc. DS70157F-page 25
Section 2. Programmer’s Model
Programmer’s
Model
2
2.19 DO STACK (dsPIC33E DEVICES)
The DO stack is used to preserve the following elements associated with a DO loop underway
when another DO loop is encountered (i.e., a nested DO loop).
• DOSTART register value
• DOEND register value
• DCOUNT register value
Note that the DO level status field (DL<2:0>) also acts as a pointer to address the DO stack. After
the DO instruction is executed, the DO level status field (DL<2:0>) points to the next free entry.
The DOSTART, DOEND, and DCOUNT registers each have an associated hardware stack that
allows the DO loop hardware to support up to three levels of nesting. A conceptual representation
of the DO stack is shown in
Figure 2-5.
Figure 2-5: DO Stack Conceptual Diagram
DCOUNTDOENDDOSTARTDL<2:0>
Empty
Level 3 Registers
000
001
010
011
100
Level 2 Registers
Level 1 Registers
Note 1: For DO register entries, DL<2:0> represents the value before the DO stack is executed.
2: For DO instruction buffer entries, DL<2:0> represents the value after the DO stack is executed.
3: If DL<2:0> = 0, no DO loops are active (DA = 0).
Protego_Release_01_05-Related-OEM-Documentation-PIC24FJ64GA004-Programmers_Reference_Manual.pdf