Vault 7: Projects

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

© 2005-2011 Microchip Technology Inc. DS70157F-page 53
Section 4. Instruction Set Details
Instruction Set
Details
4
Example 4-1: File Register Addressing
Example 4-2: File Register Addressing and WREG
4.1.2 Register Direct Addressing
Register direct addressing is used to access the contents of the 16 working registers (W0:W15).
The Register Direct Addressing mode is fully orthogonal, which allows any working register to be
specified for any instruction that uses register direct addressing, and it supports both byte and
word accesses. Instructions which employ register direct addressing use the contents of the
specified working register as data to execute the instruction, therefore this Addressing mode is
useful only when data already resides in the working register core. Sample instructions which
utilize register direct addressing are shown in
Example 4-3.
Another feature of register direct addressing is that it provides the ability for dynamic flow control.
Since variants of the DO and REPEAT instruction support register direct addressing, flexible
looping constructs may be generated using these instructions.
DEC 0x1000 ; decrement data stored at 0x1000
Before Instruction:
Data Memory 0x1000 = 0x5555
After Instruction:
Data Memory 0x1000 = 0x5554
MOV 0x27FE, W0 ; move data stored at 0x27FE to W0
Before Instruction:
W0 = 0x5555
Data Memory 0x27FE = 0x1234
After Instruction:
W0 = 0x1234
Data Memory 0x27FE = 0x1234
AND 0x1000 ; AND 0x1000 with WREG, store to 0x1000
Before Instruction:
W0 (WREG) = 0x332C
Data Memory 0x1000 = 0x5555
After Instruction:
W0 (WREG) = 0x332C
Data Memory 0x1000 = 0x1104
AND 0x1000, WREG ; AND 0x1000 with WREG, store to WREG
Before Instruction:
W0 (WREG) = 0x332C
Data Memory 0x1000 = 0x5555
After Instruction:
W0 (WREG) = 0x1104
Data Memory 0x1000 = 0x5555
Note: Instructions which must use register direct addressing, use the symbols Wb, Wn,
Wns and Wnd in the summary tables of
Section 3. “Instruction Set Overview”.
Commonly, register direct addressing may also be used when register indirect
addressing may be used. Instructions which use register indirect addressing, use
the symbols Wd and Ws in the summary tables of
Section 3. “Instruction Set
Overview”.

e-Highlighter

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

Un-highlight all Un-highlight selectionu Highlight selectionh