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.

CMP Compare CMPOperation:Assembler Syntax:S2 - S1 (parallel move) CMP S1, S2 (parallel move)Description: Subtract the source one operand, S1, from the source two accumulator,S2, and update the condition code register. The result <strong>of</strong> the subtraction operation is notstored.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 A1 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:CMP YO,B XO,X:(R6)+N6 Y1,Y:(RO)- ;comp. YO and B, save XO, Y1Before ExecutionAfter ExecutionB I $00:000020:000000 BI$00:000020:000000YO I $000024 YO I $000024SR I $0300 SR I $0319-Explanation <strong>of</strong> Example: Prior to execution, the 56-bit B accumulator contains thevalue $00:000020:000000 and the 24-bit YO register contains the value $000024. Theexecution <strong>of</strong> the CMP YO,B instruction automatically appends the 24-bit value in the YOregister with 24 LS zeros, sign extends the resulting 48-bit long word to 56 bits, subtractsthe result from the 56-bit B accumulator and updates the condition code register.

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

Saved successfully!

Ooh no, something went wrong!