Vault 7: Projects
This publication series is about specific projects related to the Vault 7 main publication.
© 2005-2011 Microchip Technology Inc. DS70157F-page 397
Section 5. Instruction Descriptions
Instruction
Descriptions
5
SFTAC
Arithmetic Shift Accumulator by Slit6
Implemented in: PIC24F PIC24H PIC24E dsPIC30F dsPIC33F dsPIC33E
X X X
Syntax: {label:} SFTAC Acc, #Slit6
Operands: Acc ∈ [A,B]
Slit6 ∈ [-16 ... 16]
Operation: Shift
k
(Acc) →Acc
Status Affected: OA, OB, OAB, SA, SB, SAB
Encoding: 1100 1000 A000 0000 01kk kkkk
Description: Arithmetic shift the 40-bit contents of the specified accumulator by the
signed, 6-bit literal and store the result back into the accumulator. The
shift range is -16:16, where a negative operand indicates a left shift and a
positive operand indicates a right shift. Any bits which are shifted out of
the accumulator are lost.
The ‘A’ bit selects the accumulator for the result.
The ‘k’ bits determine the number of bits to be shifted.
Note 1: If saturation is enabled for the target accumulator (SATA,
CORCON<7> or SATB, CORCON<6>), the value stored to
the accumulator is subject to saturation.
2: If the shift amount is greater than 16 or less than -16, no
modification will be made to the accumulator, and an
arithmetic trap will occur.
Words: 1
Cycles: 1
Example 1:
SFTAC A, #12
; Arithmetic right shift ACCA by 12
; Store result to ACCA
; CORCON = 0x0080 (SATA = 1)
Before
Instruction
After
Instruction
ACCA 00 120F FF00 ACCA 00 0001 20FF
CORCON 0080 CORCON 0080
SR 0000 SR 0000
Example 2:
SFTAC B, #-10
; Arithmetic left shift ACCB by 10
; Store result to ACCB
; CORCON = 0x0040 (SATB = 1)
Before
Instruction
After
Instruction
ACCB FF FFF1 8F4C ACCB FF C63D 3000
CORCON 0040 CORCON 0040
SR 0000 SR 0000
Protego_Release_01_05-Related-OEM-Documentation-PIC24FJ64GA004-Programmers_Reference_Manual.pdf