Vault 7: Projects
This publication series is about specific projects related to the Vault 7 main publication.
© 2005-2011 Microchip Technology Inc. DS70157F-page 403
Section 5. Instruction Descriptions
Instruction
Descriptions
5
SL
Shift Left by Short Literal
Implemented in: PIC24F PIC24H PIC24E dsPIC30F dsPIC33F dsPIC33E
X X X X X X
Syntax: {label:} SL Wb, #lit4, Wnd
Operands: Wb ∈ [W0 ... W15]
lit4 ∈ [0...15]
Wnd ∈ [W0 ... W15]
Operation: lit4<3:0> → Shift_Val
Wnd<15:Shift_Val> = Wb<15-Shift_Val:0>
Wd<Shift_Val – 1:0> = 0
Status Affected: N, Z
Encoding: 1101 1101 0www wddd d100 kkkk
Description: Shift left the contents of the source register Wb by the 4-bit unsigned
literal and store the result in the destination register Wnd. Any bits
shifted out of the source register are lost. Direct addressing must be
used for Wb and Wnd.
The ‘w’ bits select the address of the base register.
The ‘d’ bits select the destination register.
The ‘k’ bits provide the literal operand, a five-bit integer number.
Note: This instruction operates in Word mode only.
Words: 1
Cycles: 1
Example 1:
SL W2, #4, W2 ; Shift left W2 by 4
; Store result to W2
Before
Instruction
After
Instruction
W2 78A9 W2 8A90
SR 0000 SR 0008 (N = 1)
Example 2:
SL W3, #12, W8 ; Shift left W3 by 12
; Store result to W8
Before
Instruction
After
Instruction
W3 0912 W3 0912
W8 1002 W8 2000
SR 0000 SR 0000
Protego_Release_01_05-Related-OEM-Documentation-PIC24FJ64GA004-Programmers_Reference_Manual.pdf