Vault 7: Projects

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

16-bit MCU and DSC Programmer’s Reference Manual
DS70157F-page 58 © 2005-2011 Microchip Technology Inc.
4.1.4 Immediate Addressing
In immediate addressing, the instruction encoding contains a predefined constant operand,
which is used by the instruction. This Addressing mode may be used independently, but it is more
frequently combined with the File Register, Direct and Indirect Addressing modes. The size of
the immediate operand which may be used varies with the instruction type. Constants of size
1-bit (#lit1), 4-bit (#bit4, #lit4 and #Slit4), 5-bit (#lit5), 6-bit (#Slit6), 8-bit (#lit8), 10-bit (#lit10
and #Slit10), 14-bit (#lit14) and 16-bit (#lit16) may be used. Constants may be signed or
unsigned and the symbols #Slit4, #Slit6 and #Slit10 designate a signed constant. All other
immediate constants are unsigned.
Table 4-4 shows the usage of each immediate operand in the
instruction set.
Table 4-4: Immediate Operands in the Instruction Set
The syntax for immediate addressing requires that the number sign (#) must immediately
precede the constant operand value. The “#” symbol indicates to the assembler that the quantity
is a constant. If an out-of-range constant is used with an instruction, the assembler will generate
an error. Several examples of immediate addressing are shown in
Example 4-7.
Note: The 6-bit (#Slit6) operand is only available in dsPIC30F, dsPIC33F, and dsPIC33E
devices.
Operand Instruction Usage
#lit1 PWRSAV
#bit4 BCLR, BSET, BTG, BTSC, BTSS, BTST, BTST.C, BTST.Z, BTSTS,
BTSTS.C, BTSTS.Z
#lit4 ASR, LSR, SL
#Slit4 ADD, LAC, SAC, SAC.R
#lit5 ADD, ADDC, AND, CP
(5)
, CPB
(5)
, IOR, MUL.SU, MUL.UU, SUB,
SUBB, SUBBR, SUBR, XOR
#Slit6
(1)
SFTAC
#lit8 MOV.B, CP
(4)
, CPB
(4)
#lit10 ADD, ADDC, AND, CP, CPB, IOR, RETLW, SUB, SUBB, XOR
#Slit10 MOV
#lit14 DISI, DO
(2)
, LNK, REPEAT
(5)
#lit15 DO
(3)
, REPEAT
(4)
#lit16 MOV
Note 1: This operand or instruction is only available in dsPIC30F, dsPIC33F, and dsPIC33E
devices.
2: This operand or instruction is only available in dsPIC30F and dsPIC33F devices.
3: This operand or instruction is only available in dsPIC33E devices.
4: This operand or instruction is only available in dsPIC33E and PIC24E devices.
5: This operand or instruction is only available in dsPIC30F, dsPIC33F, PIC24F, and
PIC24H devices.

e-Highlighter

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

Un-highlight all Un-highlight selectionu Highlight selectionh