# Vault 7: Projects

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

### Protego

# PIC24FJ64GA004 - Programmers Reference Manual

- 1
- 2
…
- 18
- 19
- 20
- 21
- 22
…
- 501
- 502

16-bit MCU and DSC Programmer’s Reference Manual
DS70157F-page 20 © 2005-2011 Microchip Technology Inc.
2.12 RCOUNT REGISTER
The 14-bit RCOUNT register (16-bit for PIC24E and dsPIC33E devices) register contains the
loop counter for the REPEAT instruction. When a REPEAT instruction is executed, RCOUNT is
loaded with the repeat count of the instruction, either “lit14” for the “REPEAT #lit14” instruction
(“lit15” for the “REPEAT #lit15” instruction for PIC24E and dsPIC33E devices), or the 14 LSb
of the Wn register for the “REPEAT Wn” instruction (entire Wn for PIC24E and dsPIC33E
devices). The REPEAT loop will be executed RCOUNT + 1 time.
2.13 DCOUNT REGISTER (dsPIC30F, dsPIC33F AND dsPIC33E DEVICES)
The 14-bit DCOUNT register (16-bit for dsPIC33E devices) contains the loop counter for
hardware DO loops. When a DO instruction is executed, DCOUNT is loaded with the loop count
of the instruction, either “lit14” for the “DO #lit14,Expr” instruction (“lit15” for the “DO
#lit15,Expr” instruction for dsPIC33E devices) or the 14 LSb of the Ws register for the “DO
Ws,Expr” instruction (entire Wn for dsPIC33E devices). The DO loop will be executed
DCOUNT + 1 times.
2.14 DOSTART REGISTER (dsPIC30F, dsPIC33F AND dsPIC33E DEVICES)
The DOSTART register contains the starting address for a hardware DO loop. When a DO
instruction is executed, DOSTART is loaded with the address of the instruction that follows the
DO instruction. This location in memory is the start of the DO loop. When looping is activated,
program execution continues with the instruction stored at the DOSTART address after the last
instruction in the DO loop is executed. This mechanism allows for zero overhead looping.
Note 1: If a REPEAT loop is executing and gets interrupted, RCOUNT may be cleared by
the Interrupt Service Routine to break out of the REPEAT loop when the foreground
code is re-entered.
2: Refer to the specific device family reference manual for complete details about
REPEAT loops.
Note 1: In dsPIC30F and dsPIC33F devices, the DCOUNT register contains a shadow
register. See
Section 2.18 “Shadow Registers” for information on shadow regis-
ters.
2: The dsPIC33E devices have a 4-level-deep, nested DO stack instead of a shadow
register.
3: Refer to the specific device family reference manual for complete details about DO
loops.
Note 1: For dsPIC30F and dsPIC33F devices, DOSTART has a shadow register. See
Section 2.18 “Shadow Registers” for information on shadowing.
2: The dsPIC33E devices have a 4-level-deep, nested DO stack instead of a shadow
register. The DOSTART register is read-only in dsPIC33E devices.
3: Refer to the specific device family reference manual for complete details about DO
loops.

- 1
- 2
…
- 18
- 19
- 20
- 21
- 22
…
- 501
- 502