11.07.2015 Views

section 7 - Index of

section 7 - Index of

section 7 - Index of

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CMPM Compare Magnitude CMPMOperation:Assembler Syntax:IS21-IS11(paraliel move) CMPM S1, S2 (parallel move)Description: Subtract the absolute value (magnitude) <strong>of</strong> the source one operand, S1,from the absolute value <strong>of</strong> the source two accumulator, S2, and update the conditioncode register. The result <strong>of</strong> the subtraction operation is not stored.Note: This instruction subtracts 56-bit operands. When a word is specified as S1, it issign extended and zero filled to form a valid 56-bit operand. For the carry to be set correctlyas a result <strong>of</strong> the subtraction, S2 must be properly sign extended. S2 can beimproperly sign extended by writing A 1 or B1 explicitly prior to executing the compare sothat A2 or B2, respectively, may not represent the correct sign extension. This note particularlyapplies to the case where it is extended to compare 24-bit operands such as XOwith A1.Example:CMPM X1,A BA,L:-(R4) ;comp. YO and B, save XO, Y1Before ExecutionAfter ExecutionAI $00:000006:000000 A I $00:000006:000000X1 I $FFFFF7 X1 I $FFFFF7SR I $0300 SR I $0319-Explanation <strong>of</strong> Example: Prior to execution, the 56-bit A accumulator contains thevalue $00:000006:000000, and the 24-bit X1 register contains the value $FFFFF7. Theexecution <strong>of</strong> the CMPM X1 ,A instruction automatically appends the 24-bit value in the X1register with 24 LS zeros, sign extends the resulting 48-bit long word to 56 bits, takes theabsolute value <strong>of</strong> the resulting 56-bit number, subtracts the result from the absolutevalue <strong>of</strong> the contents <strong>of</strong> the 56-bit A accumulator, and updates the condition code register.

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

Saved successfully!

Ooh no, something went wrong!