Page 10
© 2004 Microchip Technology Incorporated. All Rights Reserved. Introduction to the dsPIC30F Architecture (Part 2) 10
Instruction Groups
l MOVE instructions
l MATH instructions
l LOGIC instructions
l ROTATE / SHIFT instructions
l BIT Manipulation instructions
l COMPARE / SKIP instructions
l PROGRAM FLOW instructions
l SHADOW / STACK instructions
l CONTROL instructions
l DSC instructions
The instruction set may be divided into different classes:
In general, Move instructions transfer data between Data RAM, special function registers or SFR’s, and the
W registers. Constants stored in Program Flash Memory or Data EEPROM can also be accessed using
special Table instructions. Note that all instructions manipulating data can operate on either byte or word
data.
Math instructions include addition, subtraction, multiplication, and division. Both integer and fractional
multiplication and division are supported.
Logic instructions include all common Boolean operations such as And, inclusive and exclusive Or, set,
clear, complement, and negate.
Rotate and Shift instructions include both left and right arithmetic and logical data shifts, as well as left and
right rotation of data with and without carry. The barrel shifter can shift data up to 16 bits left or right in a
single instruction cycle.
A rich set of Bit Manipulation instructions enable efficient execution of control operations. Individual data
bits can be set, cleared, toggled, tested, and copied. In addition, Find First One from Left or Right
instructions facilitate quick data searches by scanning a data word for the first non-zero bit. Another
instruction, Find First Bit Change from Left, scans a word for the first bit that differs from the sign bit.
Stack operations include Push and Pop instructions. C compilers can effectively use the W14 register as a
Frame Pointer in conjunction with the Link and Unlink instructions, to pass parameters during subroutine
calls.
Program Flow instructions include Branches, Goto, Calls, and Returns. Special registers allow Do and
Repeat loops to operate with zero overhead. Conditional execution is supported by Bit Test and Skip
instructions and Compare and Skip instructions.
Control instructions support special operations such as clearing the Watch Dog Timer, disabling interrupts
for a certain period, entering the low power operation modes, or resetting the device.
Finally, the DSP instructions provide support for a wide range of signal processing oriented operations
such as signed and unsigned multiply and MAC, square, and Euclidean distance.