11.07.2015 Views

section 7 - Index of

section 7 - Index of

section 7 - Index of

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

ADD Add ADDOperation:S+D-+D (parallel moveAssembler Syntax:ADD S,D (parallel move)Description: Add the source operand S to the destination operand D and store the resultin the destination accumulator. Words (24 bits), long words (48 bits), and accumulators(56 bits) may be added to the destination accumulator.Note: The carry bit is set correctly using word or long-word source operands if the extensionregister <strong>of</strong> the destination accumulator (A2 or B2) is the sign extension <strong>of</strong> bit 47 <strong>of</strong>the destination accumulator (A or B). Thus, the carry bit is always set correctly using accumulatorsource operands, but can be set incorrectly if A1, B1, A1 0, or B1 0 are used assource operands and A2 and B2 are not replicas <strong>of</strong> bit 47.Example:ADD XO,AA,X1 A,Y:(R1)+1 ;24-bit add, set up X1 , save prevo resultXOBefore Execution~I ________ $_F_FF_FF_F __ ~After ExecutionXO ~I ________ $F_FF_F_FF ____ ~A 1~ ___ $_O_O:_OO_01_00_:0_00_0_00 __ ~A ~I ___ $_O_O:O_O_OO_FF_:O_OO_O_OO_----'-Explanation <strong>of</strong> Example: Prior to execution, the 24-bit XO register contains the value$FFFFFF and the 56-bit A accumulator contains the value $00:000100:000000. TheADD instruction automatically appends the 24-bit value in the XO register with 24 LSzeros, sign extends the resulting 48-bit long word to 56 bits, and adds the result to the56-bit A accumulator. Thus, 24-bit operands are added to the MSP portion <strong>of</strong> A or B (A1or B1) because all arithmetic instructions assume a fractional, twos complement datarepresentation. Note that 24-bit operands can be added to the LSP portion <strong>of</strong> A or B (AOor BO) by loading the 24-bit operand into XO or YO, forming a 48-bit word by loading X1 orY1 with the sign extension <strong>of</strong> XO or YO and executing an ADD X,A or ADD Y,A instruction.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!