section 7 - Index of

section 7 - Index of section 7 - Index of

11.07.2015 Views

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 of the destination accumulator (A2 or B2) is the sign extension of bit 47 ofthe 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 of 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 of 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 of 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 of 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 of XO or YO and executing an ADD X,A or ADD Y,A instruction.

ADD Add ADDCondition Codes:15 14 13 12 11 10 9 8 7 6 5 4 3 2 01 LF 10M 1 T 1-- I SI I so I 11 I lOiS I LIE I U N I z v I :.1.... MR ..... CCR _.S -L -E -U -N -Z -V -C -Computed according to the definition in A.5 CONDITION CODE COMPUTATIONSet if limiting (parallel move) or overflow has occurred in resultSet if the signed integer portion of A or B result is in useSet if A or B result is unnormalizedSet if bit 55 of A or B result is setSet if A or B result equals zeroSet if overflow has occurred in A or B resultSet if a carry (or borrow) occurs from bit 55 of A or B result.Note: The definitions of the E and U bits vary according to the scaling mode being used.Refer to Section A.5 for complete details.Instruction Format:ADD S,DOpcode:23 8 7 4 3DATA BUS MOVE FIELD I 0 J J J I doo 0 0OPTIONAL EFFECTIVE ADDRESS EXTENSIONInstruction Fields:S,D JJJd S,D JJJdB,A 0010 XO,A 1 000A,B 001 1 XO,B 1 001X,A 0100 VO,A 1 0 1 0X,B 1 01 VO,B 1 0 1 1V,A 1 1 0 X1,A 1 1 00V,B o 1 1 1 X1,B 1 1 0 1Timing: 2+mv oscillator clock cyclesS,DJJJdV1,A 1 1 1 0V1,8 1 1 1 1Memory: 1 +mv program words

ADD Add ADDCondition Codes:15 14 13 12 11 10 9 8 7 6 5 4 3 2 01 LF 10M 1 T 1-- I SI I so I 11 I lOiS I LIE I U N I z v I :.1.... MR ..... CCR _.S -L -E -U -N -Z -V -C -Computed according to the definition in A.5 CONDITION CODE COMPUTATIONSet if limiting (parallel move) or overflow has occurred in resultSet if the signed integer portion <strong>of</strong> A or B result is in useSet if A or B result is unnormalizedSet if bit 55 <strong>of</strong> A or B result is setSet if A or B result equals zeroSet if overflow has occurred in A or B resultSet if a carry (or borrow) occurs from bit 55 <strong>of</strong> A or B result.Note: The definitions <strong>of</strong> the E and U bits vary according to the scaling mode being used.Refer to Section A.5 for complete details.Instruction Format:ADD S,DOpcode:23 8 7 4 3DATA BUS MOVE FIELD I 0 J J J I doo 0 0OPTIONAL EFFECTIVE ADDRESS EXTENSIONInstruction Fields:S,D JJJd S,D JJJdB,A 0010 XO,A 1 000A,B 001 1 XO,B 1 001X,A 0100 VO,A 1 0 1 0X,B 1 01 VO,B 1 0 1 1V,A 1 1 0 X1,A 1 1 00V,B o 1 1 1 X1,B 1 1 0 1Timing: 2+mv oscillator clock cyclesS,DJJJdV1,A 1 1 1 0V1,8 1 1 1 1Memory: 1 +mv program words

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

Saved successfully!

Ooh no, something went wrong!