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 104 © 2005-2011 Microchip Technology Inc.
Example 2:
ADD B ; Add ACCA to ACCB
; Assume Super Saturation mode enabled
; (ACCSAT = 1, SATA = 1, SATB = 1)
Before
Instruction
After
Instruction
ACCA 00 E111 2222 ACCA 00 E111 2222
ACCB 00 7654 3210 ACCB 01 5765 5432
SR 0000 SR 4800 (OB, OAB = 1)
ADD
16-bit Signed Add to Accumulator
Implemented in: PIC24F PIC24H PIC24E dsPIC30F dsPIC33F dsPIC33E
X X X
Syntax: {label:} ADD Ws, {#Slit4,} Acc
[Ws],
[Ws++],
[Ws--],
[--Ws],
[++Ws],
[Ws+Wb],
Operands:
Ws ∈ [W0 ... W15]
Wb ∈ [W0 ... W15]
Slit4 ∈ [-8 ... +7]
Acc ∈ [A,B]
Operation:
Shift
Slit4
(Extend(Ws)) + (Acc) → Acc
Status Affected:
OA, OB, OAB, SA, SB, SAB
Encoding: 1100 1001 Awww wrrr rggg ssss
Description: Add a 16-bit value specified by the source working register to the most
significant word of the selected accumulator. The source operand may
specify the direct contents of a working register or an effective address. The
value specified is added to the most significant word of the accumulator by
sign-extending and zero backfilling the source operand prior to the operation.
The value added to the accumulator may also be shifted by a 4-bit signed
literal before the addition is made.
The ‘A’ bit specifies the destination accumulator.
The ‘w’ bits specify the offset register Wb.
The ‘r’ bits encode the optional shift.
The ‘g’ bits select the source Address mode.
The ‘s’ bits specify the source register Ws.
Note: Positive values of operand Slit4 represent an arithmetic shift right
and negative values of operand Slit4 represent an arithmetic shift
left. The contents of the source register are not affected by Slit4.
Protego_Release_01_05-Related-OEM-Documentation-PIC24FJ64GA004-Programmers_Reference_Manual.pdf