section 7 - Index of

section 7 - Index of section 7 - Index of

11.07.2015 Views

NORM Normalize Accumulator Iteration NORMOperation:If E. U • Z=1, then ASL 0 and Rn-1~Rnelse if E=1, then ASR 0 and Rn+ 1 ~Rnelse NOPwhere E denotes the logical complement of E, andwhere • denotes the logical AND operatorAssembler Syntax:NORM Rn,ODescription: Perform one normalization iteration on the specified destination operand 0,update the specified address register Rn based upon the results of that iteration, andstore the result back in the destination accumulator. This is a 56-bit operation. If theaccumulator extension is not in use, the accumulator is un normalized, and the accumulatoris not zero, the destination operand is arithmetically shifted one bit to the left, and thespecified address register is decremented by 1. If the accumulator extension register isin use, the destination operand is arithmetically shifted one bit to the right, and the specifiedaddress register is incremented by 1. If the accumulator is normalized or zero, aNOP is executed and the specified address register is not affected. Since the operationof the NORM instruction depends on the E, U, and Z condition code register bits, thesebits must correctly reflect the current state of the destination accumulator prior to executingthe NORM instruction. Note that the L and V bits in the condition code register will becleared unless they have been improperly set up prior to executing the NORM instruction.Example:REP #$2FNORM R3,A;maximum number of iterations needed;perform 1 normalization iterationBefore ExecutionA 1,-_$_0_0:0_0_00_00_:0_00_00_1_--,R31~ _____ $0_O_OO_~After ExecutionAI~ ____ $_00_:4_00_0_00_:0_00_oo_0_~R31~ ______ $_FF_D_2 __ ~Explanation of Example: Prior to execution, the 56-bit A accumulator contains thevalue $00:000000:000001, and the 16-bit R3 address register contains the value $0000.The repetition of the NORM R3,A instruction normalizes the value in the 56-bit accumulatorand stores the resulting number of shifts performed during that normalization pro-

NORM Normalize Accumulator Iteration NORMcess in the R3 address register. A negative value reflects the number of left shiftsperformed; a positive value reflects the number of right shifts performed during the normalizationprocess.Condition Codes:I LF I DM I T I" I 81 I 80 I 1115 14 13 12 11 10 9 8 7 6I 10 I 8 I L5 4 3 2 1 0E I U N ZCCRN -Z -V -Set if bit 55 of A or B result is setSet if A or B result equals zeroSet if bit 55 is changed as a result of a left shiftNote: The definitions of the E and U bits vary according to the scaling mode being used.Refer to Section A.5 CONDITION CODE COMPUTATION for complete details.Instruction Format:NORM Rn,DOpcode:23 16 1510 0 0 0 0 0 08 7 oo 0 1 d 1 0 1 1Instruction Fields:o d Rn R R RA 0 Rn n n nB 1where "nnn" = Rn numberTiming: 2 oscillator clock cyclesMemory: 1 program word

NORM Normalize Accumulator Iteration NORMOperation:If E. U • Z=1, then ASL 0 and Rn-1~Rnelse if E=1, then ASR 0 and Rn+ 1 ~Rnelse NOPwhere E denotes the logical complement <strong>of</strong> E, andwhere • denotes the logical AND operatorAssembler Syntax:NORM Rn,ODescription: Perform one normalization iteration on the specified destination operand 0,update the specified address register Rn based upon the results <strong>of</strong> that iteration, andstore the result back in the destination accumulator. This is a 56-bit operation. If theaccumulator extension is not in use, the accumulator is un normalized, and the accumulatoris not zero, the destination operand is arithmetically shifted one bit to the left, and thespecified address register is decremented by 1. If the accumulator extension register isin use, the destination operand is arithmetically shifted one bit to the right, and the specifiedaddress register is incremented by 1. If the accumulator is normalized or zero, aNOP is executed and the specified address register is not affected. Since the operation<strong>of</strong> the NORM instruction depends on the E, U, and Z condition code register bits, thesebits must correctly reflect the current state <strong>of</strong> the destination accumulator prior to executingthe NORM instruction. Note that the L and V bits in the condition code register will becleared unless they have been improperly set up prior to executing the NORM instruction.Example:REP #$2FNORM R3,A;maximum number <strong>of</strong> iterations needed;perform 1 normalization iterationBefore ExecutionA 1,-_$_0_0:0_0_00_00_:0_00_00_1_--,R31~ _____ $0_O_OO_~After ExecutionAI~ ____ $_00_:4_00_0_00_:0_00_oo_0_~R31~ ______ $_FF_D_2 __ ~Explanation <strong>of</strong> Example: Prior to execution, the 56-bit A accumulator contains thevalue $00:000000:000001, and the 16-bit R3 address register contains the value $0000.The repetition <strong>of</strong> the NORM R3,A instruction normalizes the value in the 56-bit accumulatorand stores the resulting number <strong>of</strong> shifts performed during that normalization pro-

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

Saved successfully!

Ooh no, something went wrong!